...

View Full Version : IsNumeric C#



christrinder
11-12-2003, 12:15 PM
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

A1ien51
11-12-2003, 01:21 PM
check out this link:
http://www.dotnet247.com/247reference/msgs/14/74368.aspx

talks about IsNumeric with C#

Eric



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum