toEscaped static method

String toEscaped(
  1. String? string, {
  2. String encode(
    1. int charCode
    )?,
})

Returns an escaped string.

If string is null then an empty string is returned. The following characters are escaped

tab newline carriage return " ' $

Example:

    print(toEscaped("Hello 'world' \n"));
    => Hello \'world\' \n

Implementation

static String toEscaped(
  String? string, {
  String Function(int charCode)? encode,
}) => Transform.toEscape(string, encode: encode);