I want to detect if my input string has Arabic
characters in it.
Maybe some code like this :
string str = "سS";
str[0].IsArabicCharacter(); //true
str[1].IsArabicCharacter(); //false
Currently using mapping but I want to migrate to some C# built in feature.
ArabicChars = "ساینبتسیکبدثصکبثحصخبدوزطئظضچج";
string str = "ل";
if(ArabicChars.Contains(str[0]) return true; else return false;
The best you're going to get is going to be the various RegEx unicode block character class: \p{name}
Regex.IsMatch(str[0], @"\p{IsThai}");
Regex.IsMatch(str[1], @"\p{IsArabic}");
MSDN Reference Pages:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With