Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

"\n" is not working when append to StringBuffer

840374Apr 6 2011 — edited Apr 8 2011
I have used the following code

StringBuffer itinerary = new StringBuffer();

But the following line is not resulting the new line.

itinerary.append("\n");


Rather if I use -> itinerary.append("\t\n");

then I am getting the line break in the result. But due to "\t" its coming as two lone gap. Is there any other way except "\n" which will work with StringBuffer?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 6 2011
Added on Apr 6 2011
7 comments
1,430 views