Function needEscaping

Check if value needs to be escaped. This function is currently tolerant to single slashes and tabs.

bool needEscaping(String) (
  String value
) pure nothrow @nogc @safe
if (isSomeString!String && is(ElementEncodingType!String : char));

Returns

true if value needs to escaped, false otherwise.

See Also

escapeValue

Example

assert("new\nline".needEscaping);
assert(!`i have \ slash`.needEscaping);
assert("i like\rcarriage\rreturns".needEscaping);
assert(!"just a text".needEscaping);