Where can I get a list of Unicode chars by class? Where can I get a list of Unicode chars by class? azure azure

Where can I get a list of Unicode chars by class?


You can retrieve this information in an automated fashion from the official Unicode data file, UnicodeData.txt, which is published here:

This is a file with semicolon-separated values in each line. The third column tells you the character class of each character.

The benefit of this is that you can get the character name for each character, so you have a better idea of what it is than by just looking at the character itself (e.g. would you know what ბ is? That’s right, it’s Ban. In Georgian. :-))


You can, of course, use LINQ:

var charInfo = Enumerable.Range(0, 0x110000)                         .Where(x => x < 0x00d800 || x > 0x00dfff)                         .Select(char.ConvertFromUtf32)                         .GroupBy(s => char.GetUnicodeCategory(s, 0))                         .ToDictionary(g => g.Key);foreach (var ch in charInfo[UnicodeCategory.LowercaseLetter]){    Console.Write(ch);}

You can find a list of Unicode categories and their short names on MSDN, e.g., "Ll" is short for UnicodeCategory.LowercaseLetter.