I want to remove all special characters from a string. Allowed characters are A-Z (uppercase or lowercase), numbers (0-9), underscore (_), white space ( ), pecentage(%) or the d
private string RemoveReservedCharacters(string strValue) { char[] ReservedChars = {'/', ':','*','?','"', '<', '>', '|'}; foreach (char strChar in ReservedChars) { strValue = strValue.Replace(strChar.ToString(), ""); } return strValue; }