Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

line brakes in string to file  RSS feed

 
Juhan Voolaid
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

OK the topic heading sounds wierd but the problem is that i want to create html files in java. So i have string:

So when i System.out.println(html); i get:


Now i want that to be written into a file.
For that i thought i use PrintWriter class, but i think i picked a wrong one.
It writes into file perfectly, but when i want to edit the created file manually - all the HTML is in one row. That is not nice. I want it to be like System.out.println(html); gave me. Allse when there is a linebreak char , it shows somekind of unix/linux what ever box like thing.

I hope you understand my problem.

Here is what i've got sofar.
 
Joe Ess
Bartender
Posts: 9429
12
Linux Mac OS X Windows
 
Juhan Voolaid
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thnx ... with scite editor it was fine, i tested before with the M$ notpad.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!