I want to replace " from a string with ^.
String str = "hello \"there"; System.out.println(str); String str1 = str.replaceAll("\"", "^"); System.out.println(str1); String str2= str1.replaceAll("^", "\""); System.out.println(str2); and the output is :
hello "there hello ^there "hello ^there why I am getting extra " in start of string and ^ in between string
I am expecting:
hello "there