Guest User

Untitled

a guest
Jun 20th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. What's new in ASP.NET 4.0
  2.  
  3. what-s-new-in-asp-net-4-0
  4.  
  5. public string SEO_makeTitle(object objTitle)
  6. {
  7. string strTitle = Convert.ToString(objTitle);
  8.  
  9. strTitle = Regex.Replace(strTitle.Trim(), @"W", " "); //replace special chars
  10. strTitle = Regex.Replace(strTitle.Trim(), @"s{2,}", " "); //replace double space
  11. strTitle = strTitle.Trim().Replace(" ", "-").ToLower();
  12.  
  13. return strTitle; //return - delimited title
  14. }
  15.  
  16. static string RemoveAccents (string input)
  17. {
  18. string normalized = input.Normalize(NormalizationForm.FormKD);
  19. Encoding removal = Encoding.GetEncoding
  20. (Encoding.ASCII.CodePage,
  21. new EncoderReplacementFallback(""),
  22. new DecoderReplacementFallback(""));
  23. byte[] bytes = removal.GetBytes(normalized);
  24. return Encoding.ASCII.GetString(bytes);
  25. }
Add Comment
Please, Sign In to add comment