fork download
  1. using System;
  2. using System.Text;
  3.  
  4. class Program
  5. {
  6. static void Main()
  7. {
  8. ShowCategory("𩸽"); // 𩸽 (U+29E3D): OtherLetter
  9. ShowCategory("𝟢"); // 𝟢 (U+1D7E2): DecimalDigitNumber
  10. }
  11.  
  12. static void ShowCategory(string s)
  13. {
  14. var bytes = Encoding.UTF32.GetBytes(s);
  15. var x = (bytes[0] << 0) | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24);
  16. Console.WriteLine("{0} (U+{1:X}): {2}", s, x, char.GetUnicodeCategory(s, 0));
  17. }
  18. }
  19.  
Success #stdin #stdout 0.05s 24392KB
stdin
Standard input is empty
stdout
𩸽 (U+29E3D): OtherLetter
𝟢 (U+1D7E2): DecimalDigitNumber