/ Published in: C#
Replace invalid to valid file name by using RegEx
Expand |
Embed | Plain Text
static string removeBadChar(string filename) { // Replace invalid characters with "_" char. return Regex.Replace(filename, @"[^\w\.-]", "_"); }
You need to login to post a comment.
