Char: Get Unicode Category
using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
char[] chars = { 'a', 'X', '8', ',', ' ', '\u0009', '!' };
foreach (char ch in chars)
Console.WriteLine("'{0}': {1}", Regex.Escape(ch.ToString()), Char.GetUnicodeCategory(ch));
}
}
Related examples in the same category
1. | Get char type: control, digit, letter, number, punctuation, surrogate, symbol and white space | | |
2. | Determining If A Character Is Within A Specified Range | | |
3. | Is a char in a range: Case Insensitive | | |
4. | Is a char in a range Exclusively | | |
5. | Using Char | | |
6. | Escape Characters | | |
7. | A stack class for characters | | |
8. | Encode or decode a message | | |
9. | Demonstrate several Char methods | | |
10. | Demonstrate the ICharQ interface: A character queue interface | | |
11. | A set class for characters | | |
12. | A queue class for characters | | |
13. | IsDigit, IsLetter, IsWhiteSpace, IsLetterOrDigit, IsPunctuation | | |
14. | Char.IsLowSurrogate(), IsHighSurrogate(), IsSurrogatePair() method | | |
15. | demonstrates IsSymbol. | | |
16. | Buffer for characters | | |
17. | Test an input character if it is contained in a character list. | | |
18. | Is vowel char | | |
19. | Filter letter and digit | | |
20. | First Char Upper | | |