This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

not getting howdy and folks in the new line, string related from scjp6.0 book

 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


i anm not getting howday and folks in the new line but special charecter is being displayed in the notepad in place of \n
 
Pushkar Choudhary
Rancher
Posts: 425
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishal Hegde wrote:i anm not getting howday and folks in the new line but special charecter is being displayed in the notepad in place of \n

Just tested this. Works fine for me. the two words are on different lines and the second line starts with a space.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could also be an encoding issue--try opening the file with a real editor, or just listing it to the command window.
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Notepad requires \r\n as line separators. Only \r or \n results in a little square. Use a proper editor like Notepad++ instead of Notepad. Notepad is just worthless, and shouldn't be used at all unless you have no other choice.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic