I had a requirement where i need to insert an escape sequence in a given string variable, at places wherever a single quotes (\') appears. I tried using
Use the replaceAll method:
replaceAll
myString.replaceAll("'", "\\'");