System.getProperty("line.separator")

转自:http://blog.sina.com.cn/s/blog_707577700100nv74.html

标题所写的代码能获得当前系统的换行符。

不要随便用         ,因为他们在不同操作系统有不同的表示。
如果在java代码中把它们写死了,那么java跨平台运行的特性就没有了。
原文地址:https://www.cnblogs.com/tv151579/p/3481623.html