You need to do:
replaceAll("\\\\n", "\n");
The replaceAll
method expects a regex in its first argument. When passing 2 \
in java string you actually pass one. The problem is that \
is an escape char also in regex so the regex for \n
is actualy \\n
so you need to put an extra \
twice.