public static IsNumericString ( string str ) : bool | ||
str | string | |
return | bool |
public static bool IsNumericString(
string str)
{
foreach (char ch in str)
{
if (ch > 0x007f || (ch != ' ' && !char.IsDigit(ch)))
return false;
}
return true;
}
}
public DerNumericString(string str, bool validate) { if (str == null) { throw new ArgumentNullException("str"); } if (validate && !DerNumericString.IsNumericString(str)) { throw new ArgumentException("string contains illegal characters", "str"); } this.str = str; }