code: private void emitStringValue(String s) {
      raw('"');
      char b = 0, c = 0;
      for (int i = 0; i < s.length(); i++) {
        b = c;
        c = s.charAt(i);
  
        switch (c) {
          case '\\':
          case '"':
            raw('\\');
            raw(c);
            break;
          case '/':
            // Special case to ensure that </script> doesn't appear in JSON
            // output
            if (b == '<')
              raw('\\');
            raw(c);
            break;
          case '\b':
            raw("\\b");
            break;
          case '\t':
            raw("\\t");
            break;
          case '\n':
            raw("\\n");
            break;
          case '\f':
            raw("\\f");
            break;
          case '\r':
            raw("\\r");
            break;
          default:
            if (shouldBeEscaped(c)) {
              String t = "000" + Integer.toHexString(c);
              raw("\\u" + t.substring(t.length() - "0000".length()));
            } else {
              raw(c);
            }
        }
      }
  
      raw('"');
    }
docs: Emits a quoted string value, escaping characters that are required to be escaped.