UCE Docs / safe_name

Signature

String safe_name(String raw)

Parameters

raw : arbitrary input string
return value : a sanitized name safe to use as a file or key name

Sanitizes a string into a safe name by normalizing or stripping characters that are unsafe in file names and identifiers (whitespace, separators, control characters). Use it before turning user input into a file name or cache key.

Example

print(safe_name("My Report: 2024/Q1!"), "\n");
Output
MyReport2024Q1