March 2011 Entries

C# IsNumeric

My replacement for the the VB Function IsNumeric... public static Boolean IsNumeric(string stringToTest) { int result; if (int.TryParse(stringToTest, out result)) { return true; } else { return false; } } Or even better... (thanks Anon) public static Boolean IsNumeric(string stringToTest) { int result; return int.TryParse(stringToTest, out result); } ......