Return to Snippet

Revision: 5206
at February 18, 2008 22:19 by tranvinhnt


Updated Code
static string removeBadChar(string filename)
        {
            // Replace invalid characters with "_" char.
            return Regex.Replace(filename, @"[^\w\.-]", "_");

        }

Revision: 5205
at February 18, 2008 22:16 by tranvinhnt


Initial Code
static string removeBadChar(string filename)
        {
            // Replace invalid characters with empty strings.
            return Regex.Replace(filename, @"[^\w\.-]", "_");

        }

Initial URL

                                

Initial Description
Replace invalid to valid file name  by using RegEx

Initial Title
Replace invalid to valid file name

Initial Tags
regex, replace

Initial Language
C#