[急问]java txt文件插入换行符
我需要在某txt文件内容中插入换行符
原来是“张三,123 李四,245”,
想变成:
张三,123
李四,245
我现在是用 content += name + number + "\n"
"\n" 感觉不起换行作用
请教正确的java程序在txt文件中的换行符
谢谢
问题点数:50、回复次数:3Top
1 楼shan1119(大天使,卐~解!)回复于 2005-05-09 16:28:32 得分 20
content += name + number + "\n\r"
Top
2 楼playforfun(CK)回复于 2005-05-09 16:34:05 得分 0
谢谢大天使
我先去试试
OK了就马上给分Top
3 楼kaleon(为人要厚道)回复于 2005-05-09 17:33:05 得分 30
Properties pp = System.getProperties();
String newLine = pp.getProperty("line.separator");
把newLine加到你的String后面。
不过好像要用到writeUTF才可以。Top




