i'm creating a little programm atm and i need to replace every linebreak with a symbol, f.e. "#". So if i enter this text:
test1
test2
test3
it should become
test1#test2#test3
i tried doing this:
String text2 = text.replaceAll("\n", "#"); //text is the inputed text
after some research i also tried
String text2 = text.replaceAll("\\\\n", "#");
because somebody says this has something to do with the compiler or idk. Any help is appreciated!