How do I get a platform-dependent new line character?

前端 未结 9 1324
予麋鹿
予麋鹿 2020-11-22 02:17

How do I get a platform-dependent newline in Java? I can’t use \"\\n\" everywhere.

9条回答
  •  忘了有多久
    2020-11-22 02:36

    If you're trying to write a newline to a file, you could simply use BufferedWriter's newLine() method.

提交回复
热议问题