Sanitize Filename

Pure
SanitizeFilename

Removes or replaces characters that are invalid in file names on Windows and other platforms, such as /, \, :, *, ?, ", <, >, |.

Type: Pure (no side effects)
Category: Fortuna|String & Text
Keywords: string & text

Inputs

NameTypeDefaultDescription
InputFStringInput parameter

Outputs

NameTypeDescription
ReturnValueFStringReturnValue output

Example Use Cases

Example 1

Clean a player-entered save slot name before writing to disk.

Example 2

Sanitize a screenshot filename generated from user input.