VB.NET has a IsNumeric method that you can use to recognize a Short, Integer, Long, Decimal or Single numeric type. From C#, you can use try/catch to look for a particular numeric type.
//long for a Single
Single num;
try
{
num = Single.Parse(someString);
}
catch (Exception e)
{
// if this is hit, someString is not a Single
}
Share with