0

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

enter image description here

Furkan Gözükara
  • 22,964
  • 77
  • 205
  • 342
  • Possible duplicate of [Remove Arabic Diacritic](http://stackoverflow.com/questions/25562974/remove-arabic-diacritic) – Taha Paksu Mar 27 '17 at 16:03

2 Answers2

4

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);
Taha Paksu
  • 15,371
  • 2
  • 44
  • 78
1

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", "");
mtesta010
  • 103
  • 1
  • 11