• Post Reply Bookmark Topic Watch Topic
  • New Topic

String question  RSS feed

 
Jimmian Lin
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Does anyone know how to make a string that is multiple lines instead of just one line?
 
Anurag Blore
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Append "\n". while printing string will be written to new line.

In case this is not what you need then please explain what you need.
 
Harshit Rastogi
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give an example of string?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String twoLineString = "This string will\nprint on two lines.";
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!