Retrieves information about a Unicode character. This class cannot be inherited.
Assembly: mscorlib (in mscorlib.dll)
Gets the decimal digit value of the specified numeric character.
Gets the decimal digit value of the numeric character at the specified index of the specified string.
Gets the digit value of the specified numeric character.
Gets the digit value of the numeric character at the specified index of the specified string.
Gets the numeric value associated with the specified character.
Gets the numeric value associated with the character at the specified index of the specified string.
Gets the Unicode category of the specified character.
Gets the Unicode category of the character at the specified index of the specified string.
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 or extracting substring with regular expressions. The UnicodeCategory enumeration defines the possible character categories.
You use the UnicodeCategory value for a specific character. The class defines methods that return the following Unicode character values:class to obtain the
The specific category to which a character or surrogate pair belongs. The value returned is a member of the UnicodeCategory enumeration.
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 UnicodeCategory.DecimalDigitNumber category.
In addition, theclass is used internally by a number of other .NET Framework types and methods that rely on character classification. These include:
The StringInfo class, which works with textual elements instead of single characters in a string.
The overloads of the Char.GetUnicodeCategory method, which determine the category to which a character or surrogate pair belongs.
When using this class in your applications, keep in mind the following programming considerations for using the Char type. The type can be difficult to use, and strings are generally preferable for representing linguistic content.
A Char object does not always correspond to a single character. Although the Char 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 String 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, ä 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.
Notes to Callers:
Recognized characters and the specific categories to which they belong are defined by the Unicode standard and can change from one version of the Unicode Standard to another. Categorization of characters in a particular version of the .NET Framework is based on a single version of the Unicode Standard regardless of the underlying operating system on which the .NET Framework is running. The following table lists versions of the .NET Framework since the .NET Framework 4 and the versions of the Unicode Standard used to classify characters.
.NET Framework version
Version of the Unicode Standard
.NET Framework 4
.NET Framework 4.5
.NET Framework 4.5.1
.NET Framework 4.5.2
.NET Framework 4.6
.NET Framework 4.6.1
.NET Framework 4.6.2
Each version of the Unicode standard includes information on changes to the Unicode character database since the previous version. The Unicode character database is used by theclass for categorizing characters.
Available since 8
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.