isNumber() fuction in c#

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

search terms:





One thought on “isNumber() fuction in c#

  1. Hello,

    I am Thomas John representing Content Grid. We are a team of content writers from all over the world who specialize in developing content for a variety of websites including ubuntumanual.org and zyxware.com

    We have an upcoming website zyxpm.com and we were seeking talented writes with a flair for programming to join our community of writers. We happened to come across your blog on the web and we were wondering whether you would be interested in writing programming related articles for us.

    We can provide sufficient compensation for your writings and we are looking forward to having you as one of our writers in our community. If you are interested in this opportunity then please contact us for the work description and rates.

    Contact id: thomas.john@zyxware.com

    Cheers,

    ————–

    Thomas John

    Content Grid.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>