\ n newline character is ignored by java

I am writing to a txt file and I am adding \ n (newline character). the symbol is clearly displayed in System.out.println. but this symbol does not appear in the text file. so the text file only consists of one long line

+2


a source to share


1 answer


What operating system are you using? If you are using Windows try "\ r \ n" - or (more generally),System.getProperty("line.separator")



+11


a source







All Articles