If you look closely, those two strings are different. It has made exactly the replacement you requested it to. All of the single quotes in the original have been replaced with double quotes. What replacement where you expecting?
Note that the backlash character is a special character in
Java String literals. It is the escape character. You place it before any special character to make Java put that character in the String.
Normally the double quote character starts or ends a String literal. "\"" is a String literal containing a single double quote character.