J
John Bowman
Hello,
Does anyone have a good/reliable approach to implementing an IsNumeric()
method that accepts a string that may represent a numerical value (eg. such
as some text retrieved from an XML file)? Thus if you pass it "1" or
"5.12345" it returns true, but "1b3q" it returns false? I know VB has this
sort of function, but was wondering how to implement something similar in
C#. I suppose I could use the Convert methods and catch any exceptions to
determine this, but is there a better technique?
TIA,
Does anyone have a good/reliable approach to implementing an IsNumeric()
method that accepts a string that may represent a numerical value (eg. such
as some text retrieved from an XML file)? Thus if you pass it "1" or
"5.12345" it returns true, but "1b3q" it returns false? I know VB has this
sort of function, but was wondering how to implement something similar in
C#. I suppose I could use the Convert methods and catch any exceptions to
determine this, but is there a better technique?
TIA,