System.Globalization.CharUnicodeInfo.GetDecimalDigitValue C# (CSharp) Method

GetDecimalDigitValue() public static method

public static GetDecimalDigitValue ( char ch ) : int
ch char
return int
        public static int GetDecimalDigitValue(char ch) {
            return (InternalGetDecimalDigitValue(ch));
        }

Same methods

CharUnicodeInfo::GetDecimalDigitValue ( String s, int index ) : int

Usage Example

 private static void VerifyNativeDigits(string[] nativeDig, string propertyName)
 {
     if (nativeDig == null)
     {
         throw new ArgumentNullException(propertyName, Environment.GetResourceString("ArgumentNull_Array"));
     }
     if (nativeDig.Length != 10)
     {
         throw new ArgumentException(propertyName, Environment.GetResourceString("Argument_InvalidNativeDigitCount"));
     }
     for (int i = 0; i < nativeDig.Length; i++)
     {
         if (nativeDig[i] == null)
         {
             throw new ArgumentNullException(propertyName, Environment.GetResourceString("ArgumentNull_ArrayValue"));
         }
         if (nativeDig[i].Length != 1)
         {
             if (nativeDig[i].Length != 2)
             {
                 throw new ArgumentException(propertyName, Environment.GetResourceString("Argument_InvalidNativeDigitValue"));
             }
             if (!char.IsSurrogatePair(nativeDig[i][0], nativeDig[i][1]))
             {
                 throw new ArgumentException(propertyName, Environment.GetResourceString("Argument_InvalidNativeDigitValue"));
             }
         }
         if ((CharUnicodeInfo.GetDecimalDigitValue(nativeDig[i], 0) != i) && (CharUnicodeInfo.GetUnicodeCategory(nativeDig[i], 0) != UnicodeCategory.PrivateUse))
         {
             throw new ArgumentException(propertyName, Environment.GetResourceString("Argument_InvalidNativeDigitValue"));
         }
     }
 }
All Usage Examples Of System.Globalization.CharUnicodeInfo::GetDecimalDigitValue