I have a string and when I try to run the replaceAll method, I am getting this strange error:
replaceAll
String str = \"something { } , op\"; str = str.r
Escape it:
str = str.replaceAll("\\{", "\n");
This is needed since the first argument to replaceAll() is a regular expression, and { has a special meaning in Java regular expressions (it's a repetition operator, hence the error message).
{