IsNumeric
Checks if a string value is numeric according to you system culture.
Source
public static bool IsNumeric(this string theValue)
{
long retNum;
return long.TryParse(theValue, System.Globalization.NumberStyles.Integer, System.Globalization.NumberFormatInfo.InvariantInfo, out retNum);
}
Example
string value = "abc";
bool isnumeric = value.IsNumeric();// Will return false;
value = "11";
isnumeric = value.IsNumeric();// Will return true;