public static void main(String[] args) { String test = "a\"b"; test = test.replaceAll("\"", "\\\\\""); System.out.println(test); }
String s = "a\"b";System.out.println(s.replace("\"", "\\\""));