reference:evaluator:makelegal

MakeLegal(
     string:string,
     [string:flags]
)
string

Arguments

string

Input string.

flags

Optional. Optional flags are:

fforward slashes: convert separators to / instead of \
nname instead of path: replace separators with _ (implies s)
ssubdirectory mode: replace : with ; and remove \\ from UNC paths

Return value

Processed string.

Description

Returns string with any illegal path characters removed or replaced.

Example:

Output( MakeLegal("*File<?>Name*.txt") )
--> #File(!)Name#.txt

Output( MakeLegal("C:\Program Files", "n") )
--> C;_Program Files

Output( MakeLegal("\\Server\\Share", "sf") )
--> Server/Share