G
Guest
is there any function to know if a character is a Digit
Thanks in advantage...
Thanks in advantage...
Marco Martin said:try this, it might not be the best solution but it works;
public bool IsInteger(Char theValue)
{
try
{
Convert.ToInt32(theValue);
return true;
}
catch
{
return false;
}
} //IsInteger
Jon Skeet said:No it doesn't - Convert.ToInt32(char) doesn't do what you think it
does. For instance, try this:
using System;
public class Test
{
static void Main()
{
Console.WriteLine (Convert.ToInt32('A'));
}
}