2017-03-27 3 views
0

に与えられたアラビア文字列からTASHKEEL/HARAKATを削除する私は、任意のアラビア語の文字列から次TASHKEEL/HARAKATを削除したい文字を削除せずにどのようにC#の

どのように私はそれを行うことができますか?他の質問から取ら

のC#.NET 4.6.2

enter image description here

+0

が重複する可能性を試してみてください[アラビア語発音区別記号を削除]( http://stackoverflow.com/questions/25562974/remove-arabic-diacritic) –

答えて

2

例文字列、

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); 
0

は、この

 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", "");