System.Char.GetUnicodeCategory Method

Categorizes a specified Unicode character into a group identified by one of the System.Globalization.UnicodeCategory values.

Syntax

public static System.Globalization.UnicodeCategory GetUnicodeCategory (char c)

Parameters

c
The Unicode character to categorize.

Returns

A System.Globalization.UnicodeCategory value that identifies the group that contains c.

Remarks

The char.GetUnicodeCategory(char) method does not always return the same System.Globalization.UnicodeCategory value as the System.Globalization.CharUnicodeInfo.GetUnicodeCategory(char) method when it is passed a particular character as a parameter. The System.Globalization.CharUnicodeInfo.GetUnicodeCategory(char) method is designed to reflect the current version of the Unicode standard. In contrast, although the char.GetUnicodeCategory(char) method usually reflects the current version of the Unicode standard, it may return a character's category based on a previous version of the standard or it may return a category that differs from the current standard in order to preserve backward compatibility. As a result, we recommend that you use the System.Globalization.CharUnicodeInfo.GetUnicodeCategory(char) method instead of char.GetUnicodeCategory(char).

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0