script.escapeControlCharacters
Replaces control characters in a string, such as newlines and tabs, with Unicode escape sequences. For example, a newline becomes \u000a. Use it to keep text on one line, such as in a log entry. To reverse it, use script.unescapeControlCharacters.
js
script.escapeControlCharacters(input)Parameters
| Parameter | Type | Description |
|---|---|---|
input | string | The string to escape. |
Returns
stringThe string with its control characters escaped.
Examples
js
const escaped = script.escapeControlCharacters("Line one\nLine two");text
Line one\u000aLine two