escape

escape given string


Parameters

escape string :string :literal :pathliteral

Attributes

jsonfor literal use in JSON strings
regexfor literal use in regular expression
shellfor use in a shell command
xmlfor use in an XML document

Returns

  • :string
  • or  :nothing

Examples

copy
str: {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.

Related