escapeValue

Escapes string by replacing special symbols with escaped sequences. These symbols are: '\\' (backslash), '\n' (newline), '\r' (carriage return) and '\t' (tab). Note: Currently the library stores values as they were loaded from file, i.e. escaped. To keep things consistent you should take care about escaping the value before inserting. The library will not do it for you.

@trusted nothrow pure
string
escapeValue
(
string value
)

Return Value

Type: string

Escaped string.

Examples

assert("a\\next\nline\top".escapeValue() == `a\\next\nline\top`); // notice how the string on the right is raw.

See Also

unescapeValue

Meta