escapeString

fun escapeString(s: String, escapeQuote: Char = '"'): String

Escapes a string for printing inside an object or array literal. Not quite the same as the escape builtin: control characters become the short escapes where they exist and hex escapes otherwise.