I am retrieving data from a database, where the field contains a String with HTML data. I want to replace all of the double quotes such that it can be used for parseJS
parseJS
String info = "Hello \"world\"!"; info = info.replace("\"", "\\\""); String info1 = "Hello "world!"; info1 = info1.replace('"', '\"').replace("\"", "\\\"");
For the 2nd field info1, 1st replace double quotes with an escape character.