Sponsored Ad

Tuesday, April 13, 2010

Check for Decimal Number in C# | IsDecimal()

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

Sponsored Ad

More Related Articles

Website Update

Followers