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
Use replace()
s = s.replace("'", "\\'");
output:
You\'ll be totally awesome, I\'m really terrible