Last active
January 10, 2018 15:22
-
-
Save ankitvijay/ade183f68709dc9250e02c144f89286e to your computer and use it in GitHub Desktop.
Get Unicode Category Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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