12 Ocak 2015

Laf laf laf hepsi boş C# SeoToUrl


public static string Seo(string text)
{
if (string.IsNullOrEmpty(text)) return text;

text = text.ToLower();
text = text.Replace("&", "ve");
text = Regex.Replace(text, @"^\s+|\s+$", "", RegexOptions.IgnoreCase | RegexOptions.Multiline);
text = Regex.Replace(text, @"\s+", "-", RegexOptions.IgnoreCase | RegexOptions.Multiline);
text = text.Replace("ğ", "g");
text = text.Replace("ı", "i");
text = text.Replace("ş", "s");
text = text.Replace("ç", "c");
text = text.Replace("ü", "u");
text = text.Replace("ö", "o");
text = Regex.Replace(text, @"[^a-z,0-9,-]", "", RegexOptions.IgnoreCase | RegexOptions.Multiline);

return text;
}

Tagged:

0 yorum:

Yorum Gönder