c# string remove special characters
public static string RemoveSpecialCharacters(this 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();
}
Also in C#:
- web api startup add imemory cache object
- c# shorten an definition
- webclient c# example post
- c# communicate with arduino
- convert from xls to xlsx C#
- datetitime contrusctor c#
- conditional compilation c#
- how to insert into a list c#
- How to get number of months between 2 dates c#
- c# post request
- c# trim string
- C# extend array
- random from list c#
- populate combobox from array c#
- asp.net c# write string to text file
- foreach c#
- unity html get request
- unity delete all children
- c# save pdf to folder
- how to use more than one condition in ef join
- c sharp list of strings
- convert generic to type c#
- c# input integer
- get out of foreach statement c#