【发布时间】:2016-11-22 19:57:40
【问题描述】:
例如,假设我有以下字符串,
String str = "Patient: " + patient +
"\nMonth: " + month +
"\nDay : " + day +
"\nYear: " + year
+"\nDescription: " + description;
//And I write this data to a file,
PrintWriter outputFile = new PrintWriter("hello.txt");
outputFile.println(str);
然后文件上的结果只有一行,当我打开它时, 有没有办法,只做格式作为传递到文件的字符串。?
提前谢谢你。
【问题讨论】:
-
你在 Windows 上,不是 'cha?