isNumber() fuction in c#

Filed in ASP.Net 1 comments

You have a string value in your C# program and want to find out if it a numeric value.
Double.TryParse method, which returns true if the input string is a number. Here we see how you can use Double.TryParse to test number strings.

public static bool IsNumeric(string s)
{
    double Result;
    return double.TryParse(s, out Result);  
}        
 
string value = "143";
if (IsNumeric(value)) 
{
  // do something
}
Check string is number,double.tr

Thanks

Incoming search terms:

  • double tryparse c# (26)
  • jquery isnumber (20)
  • c# isnumber (14)
  • C# Double TryParse (14)
  • jquery tryparse (13)
  • jquery double tryparse (2)
  • net check string is number (1)
  • jqurery tryparseint (1)
  • jquery tryparse double (1)
  • sqloledb function isnumber (1)

Posted by Ashish Patel   @   11 October 2011 1 comments
Tags : , , , ,

Share This Post

RSS Digg Twitter StumbleUpon Delicious Technorati

1 Comments

Previous Post
«
Next Post
»
CrossBlock designed by DeltaManual.Com  |  In conjunction with Web Hosting   |   Web Hosting   |   Reverse phone