java saving String to file

Joined
Sep 29, 2006
Messages
1
Reaction score
0
Hi, there i has a problem :???: of remaining the format of the string after it was save in a text file: Could anyone please help me. Thanks alot.

System.out.println(mergeResult);

has the output of:

Hilton 4445,
high way,
streetOne
Full name : David
Nickname : vid

FileWriter WriteResult = new FileWriter("file.txt");
PrintWriter ResultOutput = new PrintWriter(WriteResult,true);
//print text to file
ResultOutput.println(mergeResult);

But, after saving it in texfile it becomes like this:

Hilton 4445, high way, streetOne Full name : David Nickname : vid
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top