I need to replace single quotes. However, I cannot use the
double quote character. Therefore, I cannot do something like this:
String s = "Hello 'thanks' bye"; s = s.replaceAll("'", "\\'"); System.out.println(s); // Hello \'thanks\' bye
I need to replace the single quotes in
\', that is, when I print
str I should get output as
Welcome \'thanks\' How are you. Without using double quotes, how do I achieve this with Apex?