I have an excel sheet with numeric and text data, and i want to process the same data into an application,but the business requirement is, system should only process the numeric data from excel to application,in order to achieve the same,
i have used below condition
in_TransactionItem(“CashIn”).ToString.IsNumeric Or in_TransactionItem(“OnUsCheck”).ToString.IsNumeric Or in_TransactionItem(“NotOnUsCheck”).ToString.IsNumeric
The above is returning all the items of excel sheet (numeric as well as text too)
When i try to use this condition - IsNumeric(in_TransactionItem(“CashIn”))
I am seeing this error - Cannot refer to instance member of a class …
If you use this in a IF condition, it will return a true or a false based on the success it achieves in trying to convert it to the desired data type. If it is true, that means the string you gave is numeric. If not, it means it contains characters that cannot be converted into a numeric.
in_TransactionItem(“CashIn”).ToString.IsNumeric() Or in_TransactionItem(“OnUsCheck”).ToString.IsNumeric() Or in_TransactionItem(“NotOnUsCheck”).ToString.IsNumeric()