quote static method

String quote(
  1. String s
)

Implementation

static String quote(String s) =>
    '"${s.replaceAll(RegExp(r'\\'), '\\\\') // backslash
        .replaceAll(RegExp(r'"'), '\\"') // closing quote character
        .replaceAll(RegExp(r'\x08'), '\\b') // backspace
        .replaceAll(RegExp(r'\t'), '\\t') // horizontal tab
        .replaceAll(RegExp(r'\n'), '\\n') // line feed
        .replaceAll(RegExp(r'\f'), '\\f') // form feed
        .replaceAll(RegExp(r'\r'), '\\r') // carriage return
        .replaceAllMapped(RegExp(r'[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]'), (Match m) => Uri.encodeFull(m[0]!))}"';