strescape
fn
string strescape(string source, string exceptions = null)Escapes the special characters '\b', '\f', '\n', '\r', '\t', '\v', '\' and '"' in the string source by inserting a '\' before them. Additionally all characters in the range 0x01-0x1F (everything below SPACE) and in the range 0x7F-0xFF (all non-ASCII chars) are replaced with a '\' followed by their octal representation. Characters supplied in exceptions are not escaped.
funcGLib.strcompress does the reverse conversion.
Parameters
source | a string to escape |
exceptions | a string of characters not to escape in source |
Returns
a newly-allocated copy of source with special characters escaped