I have a string and when I try to run the replaceAll method, I am getting this strange error:
String str = \"something { } , op\";
str = str.r
If you really intend to replace single characters and not regexes (which is what you seem to want to do here), you should use .replace(), not .replaceAll(). In spite of its name, .replace() will replace ALL occurrences, not just the first one.
And in case you wonder, String implements CharSequence, so .replace("{", "\n") will work.