Very often it happens to have to remove all special characters from a string. There are many ways to do this. One of the fastest and most elegant ways to do this is to use regular expressions.
In the following example will remove all special characters:
string inputString = "Test< Sr?i#!ng";
string cleanStrean= Regex.Replace(inputString, @"[^0-9a-zA-Z\._]", "");