System.Globalization.CharUnicodeInfo.GetDecimalDigitValue Method

Gets the decimal digit value of the numeric character at the specified index of the specified string.

Syntax

public static int GetDecimalDigitValue (string s, int index)

Parameters

s
The string containing the Unicode character for which to get the decimal digit value.
index
The index of the Unicode character for which to get the decimal digit value.

Returns

The decimal digit value of the numeric 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 decimal digit.

Remarks

This method converts characters that represent decimal digits to their equivalent integral values. Decimal digits are characters in the UnicodeCategory.DecimalDigitNumber category that can represent one of ten digits in the decimal (base 10) numbering system, from zero through nine. It includes characters such as U+0030 (DIGIT ZERO) through U+0039 (DIGIT NINE), U+0660 (ARABIC-INDIC DIGIT ZERO) through U+0669 (ARABIC-INDIC DIGIT NINE), U+07C0 (NKO DIGIT ZERO) through U+07C9 (NKO DIGIT NINE), and U+1040 (MYANMAR DIGIT ZERO) through U+1049 (MYANMAR DIGIT NINE).

For more information about Unicode characters, see the tp://go.microsoft.com/fwlink/?linkid=37123.

Requirements

Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0