开发者

\n newline character is ignored by java

开发者 https://www.devze.com 2022-12-29 04:42 出处:网络
I\'m writing to a txt file and I\'m appending \\n (newline character). the character is shown clearly 开发者_运维技巧in System.out.println. but this character is not shown in the textfile. therefore,

I'm writing to a txt file and I'm appending \n (newline character). the character is shown clearly 开发者_运维技巧in System.out.println. but this character is not shown in the textfile. therefore, the textfile is composed by only one long line


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号