mscorlib 2.0.0.0 4.0.0.0 System.Object

The Unicode Standard defines a number of Unicode character categories. For example, a character might be categorized as an uppercase letter, a lowercase letter, a decimal digit number, a letter number, a paragraph separator, a math symbol, or a currency symbol. Your application can use the character category to govern string-based operations, such as parsing. The enumeration defines the possible character categories.

You use the class to obtain the value for a specific character. The class defines methods that return the following Unicode character values:

Numeric value. Applies only to numeric characters, including fractions, subscripts, superscripts, Roman numerals, currency numerators, encircled numbers, and script-specific digits.

Digit value. Applies to numeric characters that can be combined with other numeric characters to represent a whole number in a numbering system.

Decimal digit value. Applies only to characters that represent decimal digits in the decimal (base 10) system. A decimal digit can be one of ten digits, from zero through nine. These characters are members of the category.

When using this class in your applications, keep in mind the following programming considerations for using the type. The type can be difficult to use, and strings are generally preferable for representing linguistic content.

A object does not always correspond to a single character. Although the type represents a single 16-bit value, some characters (such as grapheme clusters and surrogate pairs) consist of two or more UTF-16 code units. For more information, see "Char Objects and Unicode Characters" in the class.

The notion of a "character" is also flexible. A character is often thought of as a glyph, but many glyphs require multiple code points. For example, ä can be represented either by two code points ("a" plus U+0308, which is the combining diaeresis), or by a single code point ("ä" or U+00A4). Some languages have many letters, characters, and glyphs that require multiple code points, which can cause confusion in linguistic content representation. For example, there is a ΰ (U+03B0, Greek small letter upsilon with dialytika and tonos), but there is no equivalent capital letter. Uppercasing such a value simply retrieves the original value.

Retrieves information about a Unicode character. This class cannot be inherited.

- Method
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  This method converts characters that represent decimal digits to their equivalent integral values. Decimal digits are characters in the 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 Unicode Standard.

  Gets the decimal digit value of the specified numeric character.

  The decimal digit value of the specified numeric character.

  -or-

  -1, if the specified character is not a decimal digit.

  The Unicode character for which to get the decimal digit value.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` ``

  This method converts characters that represent decimal digits to their equivalent integral values. Decimal digits are characters in the 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 Unicode Standard.

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

  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.

  The containing the Unicode character for which to get the decimal digit value. The index of the Unicode character for which to get the decimal digit value.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  Digit value is a property that applies only to numeric characters that can be used as digits. A digit is a numeric character that can be combined with other digits to represent a whole number in a numbering system.

  For more information on Unicode characters, see the Unicode Standard.

  Gets the digit value of the specified numeric character.

  The digit value of the specified numeric character.

  -or-

  -1, if the specified character is not a digit.

  The Unicode character for which to get the digit value.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` ``

  Digit value is a property that applies only to numeric characters that can be used as digits. A digit is a numeric character that can be combined with other digits to represent a whole number in a numbering system.

  For more information on Unicode characters, see the Unicode Standard.

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

  The 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 digit.

  The containing the Unicode character for which to get the digit value. The index of the Unicode character for which to get the digit value.
- Method
  2.0.0.0
  4.0.0.0
  System.Double ``

  Numeric value is a Unicode character property that applies only to numeric characters, which include fractions, subscripts, superscripts, Roman numerals, currency numerators, encircled numbers, and script-specific digits. For more information on Unicode characters, see the Unicode Standard.

  The method assumes that corresponds to a single linguistic character and checks whether that character can be converted to a decimal digit. However, some numbers in the Unicode standard are represented by two objects that form a surrogate pair. For example, the Aegean numbering system consists of code points U+10107 through U+10133. The following example uses the method to instantiate a string that represents AEGEAN NUMBER ONE. As the output from the example shows, the method returns -1 if it is passed either a high surrogate or a low surrogate of this character.

  code reference: System.Globalization.CharUnicodeInfo.GetNumericValue#2

  Gets the numeric value associated with the specified character.

  The numeric value associated with the specified character.

  -or-

  -1, if the specified character is not a numeric character.

  The Unicode character for which to get the numeric value.
- Method
  2.0.0.0
  4.0.0.0
  System.Double `` ``

  Numeric value is a Unicode character property that applies only to numeric characters, which include fractions, subscripts, superscripts, Roman numerals, currency numerators, encircled numbers, and script-specific digits. For more information on Unicode characters, see the Unicode Standard.

  If the object at position is the first character of a valid surrogate pair, the method determines whether the surrogate pair forms a numeric digit, and, if it does, returns its numeric value. For example, the Aegean numbering system consists of code points U+10107 through U+10133. The following example uses the method to instantiate a string that represents each Aegean number. As the output from the example shows, the method returns the correct numeric value if it is passed the high surrogate of an Aegean number. However, if it is passed the low surrogate, it considers only the low surrogate in isolation and returns -1.

  code reference: System.Globalization.CharUnicodeInfo.GetNumericValue#3

  Gets the numeric value associated with the character at the specified index of the specified string.

  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.

  The containing the Unicode character for which to get the numeric value. The index of the Unicode character for which to get the numeric value.
- Method
  2.0.0.0
  4.0.0.0
  System.Globalization.UnicodeCategory ``

  The Unicode characters are divided into categories. A character's category is one of its properties. For example, a character might be an uppercase letter, a lowercase letter, a decimal digit number, a letter number, a connector punctuation, a math symbol, or a currency symbol. The class returns the category of a Unicode character. For more information on Unicode characters, see the Unicode Standard.

  The method assumes that corresponds to a single linguistic character and returns its category. This means that, for surrogate pairs, it returns instead of the category to which the surrogate belongs. For example, the Ugaritic alphabet occupies code points U+10380 to U+1039F. The following example uses the method to instantiate a string that represents UGARITIC LETTER ALPA (U+10380), which is the first letter of the Ugaritic alphabet. As the output from the example shows, the method returns false if it is passed either the high surrogate or the low surrogate of this character.

  code reference: System.Globalization.CharUnicodeInfo.GetUnicodeCategory#1

  Note that does not always return the same value as the method when passed a particular character as a parameter. The method is designed to reflect the current version of the Unicode standard. In contrast, although the method usually reflects the current version of the Unicode standard, it might return a character's category based on a previous version of the standard, or it might return a category that differs from the current standard to preserve backward compatibility.

  Gets the Unicode category of the specified character.

  A value indicating the category of the specified character.

  The Unicode character for which to get the Unicode category.
- Method
  2.0.0.0
  4.0.0.0
  System.Globalization.UnicodeCategory `` ``

  The Unicode characters are divided into categories. A character's category is one of its properties. For example, a character might be an uppercase letter, a lowercase letter, a decimal digit number, a letter number, a connector punctuation, a math symbol, or a currency symbol. The class returns the category of a Unicode character. For more information on Unicode characters, see the Unicode Standard.

  If the object at position is the first character of a valid surrogate pair, the method returns the Unicode category of the surrogate pair instead of returning . For example, the Ugaritic alphabet occupies code points U+10380 to U+1039F. The following example uses the method to instantiate a string that represents UGARITIC LETTER ALPA (U+10380), which is the first letter of the Ugaritic alphabet. As the output from the example shows, the method returns if it is passed the high surrogate of this character, which indicates that it considers the surrogate pair. However, if it is passed the low surrogate, it considers only the low surrogate in isolation and returns .

  code reference: System.Globalization.CharUnicodeInfo.GetUnicodeCategory#2

  Note that method does not always return the same value as the method when passed a particular character as a parameter. The method is designed to reflect the current version of the Unicode standard. In contrast, although the method usually reflects the current version of the Unicode standard, it might return a character's category based on a previous version of the standard, or it might return a category that differs from the current standard to preserve backward compatibility.

  Gets the Unicode category of the character at the specified index of the specified string.

  A value indicating the category of the character at the specified index of the specified string.

  The containing the Unicode character for which to get the Unicode category. The index of the Unicode character for which to get the Unicode category.