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

GetNumericValue() public static method

public static GetNumericValue ( String s, int index ) : double
s String
index int
return double
        public static double GetNumericValue(String s, int index) {
            if (s == null) {
                throw new ArgumentNullException("s");
            }
            if (index < 0 || index >= s.Length) {
                throw new ArgumentOutOfRangeException("index", Environment.GetResourceString("ArgumentOutOfRange_Index"));
            }
            return (InternalGetNumericValue(InternalConvertToUtf32(s, index)));

        }

Same methods

CharUnicodeInfo::GetNumericValue ( char ch ) : double

Usage Example

 /// <summary>Gets the numeric value associated with the character at the specified index of the specified string.</summary>
 /// <returns>The numeric value associated with the character at the specified index of the specified string.-or- -1, if the character at the specified index of the specified string is not a numeric character.</returns>
 /// <param name="s">The <see cref="T:System.String" /> containing the Unicode character for which to get the numeric value. </param>
 /// <param name="index">The index of the Unicode character for which to get the numeric value. </param>
 /// <exception cref="T:System.ArgumentNullException">
 ///   <paramref name="s" /> is null. </exception>
 /// <exception cref="T:System.ArgumentOutOfRangeException">
 ///   <paramref name="index" /> is outside the range of valid indexes in <paramref name="s" />. </exception>
 public static double GetNumericValue(string s, int index)
 {
     if (s == null)
     {
         throw new ArgumentNullException("s");
     }
     return(CharUnicodeInfo.GetNumericValue(s[index]));
 }
All Usage Examples Of System.Globalization.CharUnicodeInfo::GetNumericValue