Skip to content

Instantly share code, notes, and snippets.

@ankitvijay
Last active January 10, 2018 15:22
Embed
What would you like to do?
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