public static string RemoveSpecialCharacters(string str) {
StringBuilder sb = new StringBuilder();
foreach (char c in str) {
if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') | || (c >= 'a' && c <= 'z') | c == '.' || c == '_') {
sb.Append(c);
}
}
return sb.ToString();
}
Showing posts with label remove special characters from string in c#.net. Show all posts
Showing posts with label remove special characters from string in c#.net. Show all posts
Sunday 5 February 2012
remove special characters from string in c#.net
Subscribe to:
Posts (Atom)