Process escape sequences in a string.
string stresc <string:Text>
| Name | Type | Comment |
|---|---|---|
| Text | string | The text string to be escaped. |
A string containing the escaped text.
string s set s "The newlines has been escaped\\r\\n...and so have the \\\"quotation marks\\\"" // echo the escaped text echo "Escaped:" echo <stresc s> // echo the unescaped text echo "Unescaped:" echo s
… the output of which is written to the event log by echo as:
Escaped: The newlines has been escaped ...and so have the "quotation marks" Unescaped: The newlines has been escaped\r\n...and so have the \"quotation marks\"
| Sequence | Interpreted as… |
|---|---|
| \n | Newline |
| \r | Carriage return |
| \t | Tab |
| \” | Quotation mark |
| \\ | Backslash |
| \0 | NULL |