J
jtl.zheng
I want to write a String type to a local file
the code like:
------------------------------
String src="xxxxxxxxxxxxxxxxxx";
BufferedWriter out = new BufferedWriter(new FileWriter("dest.txt"));
out.write(src);
out.close();
------------------------------
and I want to make a new line in the dest.txt
just like:
"xxxxxxxxx
yyyyyyyyy" (next line)
what should I add to the String src
a char '\n' ??
but when I add this char '\n' to the String src I can't see the new
line when open the dest.txt file in NOTEPAD.EXE
it is just like:
"xxxxxxxxxyyyyyyyyy"
thank you
^_^
the code like:
------------------------------
String src="xxxxxxxxxxxxxxxxxx";
BufferedWriter out = new BufferedWriter(new FileWriter("dest.txt"));
out.write(src);
out.close();
------------------------------
and I want to make a new line in the dest.txt
just like:
"xxxxxxxxx
yyyyyyyyy" (next line)
what should I add to the String src
a char '\n' ??
but when I add this char '\n' to the String src I can't see the new
line when open the dest.txt file in NOTEPAD.EXE
it is just like:
"xxxxxxxxxyyyyyyyyy"
thank you
^_^