X

C# detect inuktitut characters Canadian Aboriginal Syllabics

dotnet C#

Here is a quick way to detect if a text is in Canadian Aboriginal Syllabic in C#.

It is just an extension method that would detect if your string is in that range by using regex.


  public static bool IsInuktitut(this string input)
        {
            if (string.IsNullOrEmpty(input))
            {
                return false;
            }
            //http://msdn.microsoft.com/en-us/library/20bw873z.aspx
            //look at section  Supported Named Blocks
            const string pattern = @"\p{IsUnifiedCanadianAboriginalSyllabics}";

            Match match = Regex.Match(input, pattern);

            return match.Success;                    
        }

Enjoy.

Categories: .NET
Taswar Bhatti:
Related Post