构造换行符:
String newline = System.getProperty("line.separator");
System.out.println("Hello world" + newline);
本文介绍了一种在程序中创建换行符的方法,通过使用System.getProperty获取操作系统的默认换行符,实现跨平台的文本换行功能。
构造换行符:
String newline = System.getProperty("line.separator");
System.out.println("Hello world" + newline);
被折叠的 条评论
为什么被折叠?