Convert special Turkish chars to international Latin chars


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. public static string ConvertTurkishChars(string text)
  2. {
  3. String[] olds = { "Ğ", "ğ", "Ü", "ü", "Ş", "ş", "İ", "ı", "Ö", "ö", "Ç", "ç" };
  4. String[] news = { "G", "g", "U", "u", "S", "s", "I", "i", "O", "o", "C", "c" };
  5.  
  6. for (int i = 0; i < olds.Length; i++)
  7. {
  8. text = text.Replace(olds[i], news[i]);
  9. }
  10.  
  11. text = text.ToUpper();
  12.  
  13. return text;
  14. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.