debug.VisualizeSpaces
Returns the given string with spaces and other whitespace characters replaced by visible placeholders.
- Syntax
- debug.VisualizeSpaces STRING
- Returns
- string
Usage
The debug.VisualizeSpaces function returns the given string with spaces and other whitespace characters replaced by visible placeholders. Use this function to find unexpected whitespace in a string.
The function replaces these characters:
| Character | Placeholder |
|---|---|
| Space | [SPACE] |
| Tab | [TAB] |
| Newline | [NEWLINE] |
| Carriage return | [CR] |
| Vertical tab | [VTAB] |
| Null | [NUL] |
| Unicode replacement character (U+FFFD) | [U+FFFD] |
The [NEWLINE] placeholder is followed by the original newline, so each line of the input remains on its own line in the output.
Examples
{{ debug.VisualizeSpaces "foo bar" }} → foo[SPACE][SPACE]bar
{{ debug.VisualizeSpaces "foo\tbar" }} → foo[TAB]barLast updated:
October 21, 2026
:
content: Apply style guide to debug functions (ae4742cb8)
Improve this page