Reputation: 23830
I want to remove the following TASHKEEL / HARAKAT from any given Arabic string without removing letters
How can i do that?
C# .net 4.6.2
Upvotes: 0
Views: 2986
Reputation: 103
try this
str= str.Replace("\u064b", "");
str= str.Replace("\u064f", "");
str= str.Replace("\u064c", "");
str= str.Replace("\u0652", "");
str= str.Replace("\u064d", "");
str= str.Replace("\u0650", "");
str= str.Replace("\u0651", "");
str= str.Replace("\u064e", "");
Upvotes: 1
Reputation: 15616
Example string taken from other question,
string str = "الْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ";
// to be replaced characters
char[] tashkeel = new char[]{'ِ', 'ُ', 'ٓ', 'ٰ', 'ْ', 'ٌ', 'ٍ', 'ً', 'ّ', 'َ'};
// doing the replacement
foreach(char c in tashkeel)
str = str.Replace(c.ToString(),"");
MessageBox.Show(str);
Upvotes: 4