Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: IsNumeric C#

  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Location
    Loughborough (UK)
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question IsNumeric C#

    Hi guys,

    I'm building-up a string by analysing each character in an input string. What I need to know, is if there is a way to check if a character is numeric or not (in c#) and be able to do one of two different actions depending on the result?

    for (int i; i<InputString.Length; i++)
    {
    letter = InputString.Substring(i, 1);
    if (IsNumeric(letter) == true)
    {
    OutPutString = OutPutString + "N";
    }
    else
    {
    OutPutString = OutPutString + "A";
    }
    }

    Thanks,
    Chris

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    check out this link:
    http://www.dotnet247.com/247referenc.../14/74368.aspx

    talks about IsNumeric with C#

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •