///
/// Checks a string to see if it could be
/// parsed as an Integer
///
/// The string containing the mnumber to be checked
/// Boolead True or False if the string could be parsed as a string or not.
public static bool IsInt(string sNumber)
{
if(sNumber == null)
return false;
char[] chars = sNumber.ToCharArray() ;
for ( int i = 0; i < chars.Length; i++ )
{
if( !Char.IsDigit( chars[ i ] ) )
{
return false ;
}
}
return true ;
}
|