可能有N种吧, 看看io吧
try {
String s = "test1\r\ntest2";
FileOutputStream out = new FileOutputStream("c:/test.txt");
out.write(s.getBytes());
out.close();
}
catch (IOException e) {
}
try {
String s = "test1\r\ntest2";
FileOutputStream out = new FileOutputStream("c:/test.txt");
out.write(s.getBytes());
out.close();
}
catch (IOException e) {
}
Write a portion of a String.其他流类里也有相似的方法