Ignore Tashkeel (Diacritics ) when comparing arabic string values
string str1 = "الْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ";
string str2 = "الحمد لله رب العالمين";
var arabicCulture = new CultureInfo("ar");
int result1 = arabicCulture.CompareInfo.Compare(str1, str2, CompareOptions.IgnoreNonSpace); // output: 0 (strings are equal)
var result2 = arabicCulture.CompareInfo.IndexOf(str1, "العالمين", CompareOptions.IgnoreNonSpace); // output 24
Written by Marwan Aouida
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#.net
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#