Current value of the String is
^I am Shaikh with "([^"]*)" and "([^"]*)"$
My code is as below:
System.out.println(strAnnotationValue); // prints ^I am Shaikh with "([^"]*)" and "([^"]*)"$
strAnnotationValue = strAnnotationValue.replaceAll("\"", "\\\"");
System.out.println(strAnnotationValue);
Actual Output: ^I am Shaikh with "([^"]*)" and "([^"]*)"$
Expected Output: ^I am Shaikh with \"([^\"]*)\" and \"([^\"]*)\"$
I have written the proper code but it is not working, is there any other ways to do this?