I need to escape all quotes (') in a string, so it becomes \'
I've tried using replaceAll, but it doesn't do anything. For some reason I can't get the regex to work.
I'm trying with
String s = "You'll be …
I am looking to replace a java string value as follows. below code is not working.
cleanInst.replaceAll("[<i>]", "");
cleanInst.replaceAll("[</i>]", "");
cleanInst.replaceAll("[//]", "/");
cleanInst.replaceAll("[\bPhysics Dept.\b]", "Physics Department");
cleanInst.replaceAll("[\b/n\b]", ";");
…
Pretty simple question, but this is coming from a C/C++ person getting into the intricacies of Java.
I understand I can fire up jUnit and a few performance tests of my own to get an answer; but I'm just …