Answers for "c# path remove invalid characters"

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
0

c# remove invalid directory characters

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

Code answers related to "c# path remove invalid characters"

C# Answers by Framework

Browse Popular Code Answers by Language