C# is numeric styles



  • Not that I'm getting involved or anything, just thought for informations sake:

    c#

    System.Double.TryParse

    or you could do a basic:

    System.Text.RegularExpressions.Regex.IsMatch(val,"^\-?\d*(\.\d*)?$")

    and System.Char has a IsNumeric (don't ask why string doesn't).  You could always roll your own

    internal static bool IsNumeric(string numberString)
    {
     foreach (char c in numberString)
      if (!char.IsNumber(c))
       return false; 
     return true;
    }



  • hmmm well there's my wtf, posted a reply as a new thread by accident.



  • This is a forum. Don't click the Post button.



  • @dhromed said:

    This is a forum. Don't click the Post button.




    That makes no sense.



  • Don't click the Preview button either.



  • @Mike R said:

    @dhromed said:
    This is a forum. Don't click the Post button.

    That makes no sense.

    Makes perfect sense, for a certain definition of "sense". [:D]

    The "post" button posts a new message to the forum. It's like starting a new topic. To reply to something somebody said, you have to click "reply". I've seen lots of forums that have this same principle at work, although they usually clarify it by saying "Post New Topic" on that button.

     


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.