I want to replace the string "pqtd" to "\n", and my code is:
String str = "this is my pqtd string";
if (str.contains("pqtd")) {
str.replaceAll("pqtd", "\n");
}
But that doesn't go, if I change all the code, doing it in reverse (trying to replace "\n" to "pqtd") it goes, so I think the problem is that Java can not replace a char sequence to "\n", at least I don't know-how.