FileUtils.SafeFilename

Returns a safe filename from a string by stripping out illegal characters

public static string SafeFilename(string fileName,
	string replacementString,
	string spaceReplacement)

Return Value

Fixed up string

Parameters

fileName
Filename to fix up

replacementString
String value to replace illegal chars with. Defaults empty string

spaceReplacement
Optional - replace spaces with a specified string like a - or _. Optional, if not set leaves spaces which are legal for filenames


See also:

Class FileUtils

© West Wind Technologies, 1996-2024 • Updated: 06/29/24
Comment or report problem with topic