Removing characters which are not allowed in Windows filenames

history edit

Windows, Regex

Regex illegalInFileName = new Regex(@"[\\/:*?""<>|]");
string myString = illegalInFileName.Replace(myString, "");

Removing characters which are not allowed in Windows filenames