![]() |
VOOZH | about |
This method is used to categorizes the character at the specified position in a specified string into a group identified by one of the UnicodeCategory values.
Syntax:
public static System.Globalization.UnicodeCategory GetUnicodeCategory (string s, int index);
Parameters:
Return Value: This method returns a UnicodeCategory enumerated constant that identifies the group that contains the character at position index in s.
Exceptions:
Below programs illustrate the use of Char.GetUnicodeCategory(String, Int32) Method:
Example 1:
the letter present at index 3 is DecimalDigitNumber the letter present at index 0 is UppercaseLetter the letter present at index 2 is LowercaseLetter
Example 2: For ArgumentNullException
the letter present at index 3 is DecimalDigitNumber the letter present at index 0 is UppercaseLetter the letter present at index 2 is LowercaseLetter s is null Exception Thrown: System.ArgumentNullException
Example 3: For ArgumentOutOfRangeException
the letter present at index 3 is DecimalDigitNumber the letter present at index 0 is UppercaseLetter the letter present at index 2 is LowercaseLetter index is less than zero Exception Thrown: System.ArgumentOutOfRangeException
Reference: