Skip to content

Instantly share code, notes, and snippets.

@ankitvijay
Last active January 10, 2018 15:22
Show Gist options
  • Select an option

  • Save ankitvijay/ade183f68709dc9250e02c144f89286e to your computer and use it in GitHub Desktop.

Select an option

Save ankitvijay/ade183f68709dc9250e02c144f89286e to your computer and use it in GitHub Desktop.
Get Unicode Category Example
using System;
namespace GetUnicodeCategoryExample
{
class Program
{
static void Main(string[] args)
{
var sampleString = @"1aB%$^()-";
for (int i = 0; i < sampleString.Length; i++)
{
Console.WriteLine($"[Char]: {sampleString[i]};" +
$" [UnicodeCategory]: {char.GetUnicodeCategory(sampleString[i])}"); // or char.GetUnicodeCategory(sampleString, i)
}
Console.Read();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment