string word1 = ""; //see example
string word2 = "";
bool b1 = word1.StartsWith(word2);
bool b2 = word1.Substring(0, word2.Length) == word2;
pour certaines chaînes arabes b1 n'est pas égal à b2? Pouvez-vous expliquer ce comportement?String.StartsWith ne fonctionne pas comme prévu
Exemple:
word1 = ((char)0x0650).ToString()+ ((char)0x0652).ToString()+ ((char)0x064e).ToString();
word2 = ((char)0x0650).ToString()+ ((char)0x0652).ToString();
Pourriez-vous s'il vous plaît donner quelques exemples? – ojlovecd
@Ahmed Ils évaluent tous les deux à 'true' comme prévu. –
J'ai la chaîne arabe casser cette affaire! –