topher-b
6/14/2016 - 3:24 PM

May be an easy way to remove special characters from a string.

May be an easy way to remove special characters from a string.

string fileName = "something";
foreach (char c in System.IO.Path.GetInvalidFileNameChars())
{
   fileName = fileName.Replace(c, '');
}