- :string
- or :nothing
escape
escape given string
Parameters
escape string :string :literal
Attributes
json | for literal use in JSON strings | |
regex | for literal use in regular expression | |
shell | for use in a shell command | |
xml | for use in an XML document |
Returns
Examples
copystr: {a long "string" + with \diffe\rent symbols.} print escape str ; "a long \"string\" + with \\diffe\\rent symbols." print escape.json str ; a long \"string\" + with \\diffe\\rent symbols. print escape.regex str ; a\x20long\x20\x22string\x22\x20\x2B\x20with\x20\x5Cdiffe\x5Crent\x20symbols\x2E print escape.shell str ; 'a long "string" + with \diffe\rent symbols.' print escape.xml str ; a long "string" + with \diffe\rent symbols.