1-) C# RMOS - replaceTurkishKarakter türkçe karakterleri ingilizceye çevirir
public string replaceTurkishKarakter(string text)
{
var unaccentedText = String.Join("", text.Normalize(NormalizationForm.FormD)
.Where(c => char.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark));
return unaccentedText;
}
public string replaceTurkishKarakter(string text)
{
text = text.Replace("Ş", "S");
text = text.Replace("ş", "s");
text = text.Replace("İ", "I");
text = text.Replace("ı", "i");
text = text.Replace("Ğ", "G");
text = text.Replace("ğ", "g");
text = text.Replace("Ç", "C");
text = text.Replace("ç", "c");
text = text.Replace("Ö", "O");
text = text.Replace("ö", "o");
text = text.Replace("Ü", "U");
text = text.Replace("ü", "u");
return text;
}
DİĞER
public string replaceTurkish(string text)
{
var json = @"{""name"":"""+ text + @"""}";
var name = JObject.Parse(json)["name"].ToString();
return name.ToString();
}
KULLANIMI
var name = replaceTurkish("Hills Young Sterilised Tavuklu K\u0131s\u0131rla\u015ft\u0131r\u0131lm\u0131\u015f Kedi Mamas\u0131 1.5 Kg")