Standard Library: Formatting

[whitespace-fmt: mode?; custom-value?]

string or empty

Gets or sets the whitespace normalization mode. This does not affect whitespace in escape sequences and string literals.

Passing no arguments to this function will simply get the current mode.

Formatting modes

ModeDescription
default(Default) Normalizes all whitespace to a single ASCII space character (0x20).
verbatimPrints all printable whitespace as it appears in the code.
ignore-allIgnores all printable whitespace.
customReplaces all whitespace sequences with the custom-value argument.

Example

[whitespace-fmt: default] The quick brown fox    jumps over the lazy dog.
# Output: The quick brown fox jumps over the lazy dog.

[whitespace-fmt: verbatim] The quick brown fox    jumps over the lazy dog.
# Output: The quick brown fox    jumps over the lazy dog.

[whitespace-fmt: ignore-all] The quick brown fox    jumps over the lazy dog.
# Output: Thequickbrownfoxjumpsoverthelazydog.

[whitespace-fmt: custom; ...\s] The quick brown fox    jumps over the lazy dog.
# Output: The... quick... brown... fox... jumps... over... the... lazy... dog.