escapeFunctorIfNecessary
fun escapeFunctorIfNecessary(string: String, escapeSingleQuotes: Boolean = true, escapeDoubleQuotes: Boolean = !escapeSingleQuotes): String
Escapes all occurrences of the characters \n, \r, \t, and \ in string, but only if a preliminary check reveals that it contains some character which require escaping. Depending on the value of parameters escapeDoubleQuotes and escapeSingleQuotes, occurrences of characters " and ' may be escaped as well.
Return
Parameters
string
the String whose characters must should be escaped
escapeDoubleQuotes
decides whether double-quote characters (i.e., ") should be escaped (defaults to true)
escapeSingleQuotes
decides whether single-quote characters (i.e., ') should be escaped (defaults to !escapeDoubleQuotes)