This small utility will help you to find that given string or number is decimal or not.
Just pass the given string in IsDecimal function and it will return true if given string is Decimal otherwise will return false.
public static bool IsDecimal(string n)
{
try
{
Decimal.Parse(n.Trim());
return true;
}
catch { return false; }
}
0 comments:
Post a Comment