I have a string like this: John \\n Barber now I want to replace \\n with actual new line character so it will become
John \\n Barber
John
Barber<
replaceAll is using Regular Expressions, you can use replace which will also replace all '\n':
replace("\\\\n", "\n");