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!

Multiple Spaces between words in Java

807580Jul 23 2010 — edited Jul 23 2010
Hi All

String s1 = "boy";
String s2 = "girl";

String s = s1 + "multiple spaces through keyboard spacebar writing this because when this is posted it will not be visible in the browser" + s2;
system.out.println(s);

I need to have multiple spaces between s1 and s2 and need to be shown in the browser(IE) in java.

If it is a html code, I found we can use <pre> tag, &nbsp;

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 20 2010
Added on Jul 23 2010
12 comments
720 views