Org.BouncyCastle.Asn1.DerNumericString.IsNumericString C# (CSharp) Method

IsNumericString() public static method

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;
		}
	}

Usage Example

Exemplo n.º 1
0
 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;
 }