I'm looking for a regular expression that can remove all the following characters from a string (and whitespace too):
~ % & \ ; : " ' , < > ? #
I tried it with following code:
var MyCleanString = Regex.Replace(InputString, @"[~%&\\;:,<>?#\s]", String.Empty);
and it is not working.