I\'m cleaning an incoming text in my Java code. The text includes a lot of \"\\n\", but not as in a new line, but literally \"\\n\". I was using replaceAll() from the String
I used this solution to solve that problem:
String replacement = str.replaceAll("[\n\r]", "");