Answers for "removing illlegal char from filename"

C#
1

removing illlegal char from filename

public string RemoveInvalidChars(string filename)
{
    return string.Concat(filename.Split(Path.GetInvalidFileNameChars()));
}
public string ReplaceInvalidChars(string filename)
{
    return string.Join("_", filename.Split(Path.GetInvalidFileNameChars()));    
}
Posted by: Guest on January-14-2021

Code answers related to "removing illlegal char from filename"

C# Answers by Framework

Browse Popular Code Answers by Language