public String quote(String in) {final StringBuilder r = new StringBuilder();r.append('\'');int start = 0, i = 0;for (; i < in.length(); i++) {switch (in.charAt(i)) {case '\'':case '!':r.append(in, start, i);r.append('\'');r.append('\\');r.append(in.charAt(i));r.append('\'');start = i + 1;break;}}r.append(in, start, i);r.append('\'');return r.toString();}

public override string Quote(string @in){StringBuilder r = new StringBuilder();r.Append('\'');int start = 0;int i = 0;for (; i < @in.Length; i++){switch (@in[i]){case '\'':case '!':{r.AppendRange(@in, start, i);r.Append('\'');r.Append('\\');r.Append(@in[i]);r.Append('\'');start = i + 1;break;}}}r.AppendRange(@in, start, i);r.Append('\'');return r.ToString();}
