I currently have a string that contains the characters A, B and C, for example, the string looks like
"A some other random stuff B C"
other random stuff does not contain A, B or CI that want to replace A, B and C with "A", "B" and "C" respectively, which is the best way to do this at the moment I'm doing
String.replace("A", "'A'").replace("B", "'B'").replace("C", "'C'")
source
share