System.getProperty("line.separator")

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

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

不要随便用 \n\r    \n    \r,因为他们在不同操作系统有不同的表示。
如果在java代码中把它们写死了,那么java跨平台运行的特性就没有了。
posted @ 2013-12-19 10:22  horizon~~~  阅读(751)  评论(0编辑  收藏  举报