Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Help > Re: How can I w...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 13 of 13 Topic 16039 of 16590
Post > Topic >>

Re: How can I write right-justified into a 12 chars width field?

by thufir <hawat.thufir@[EMAIL PROTECTED] > Apr 30, 2008 at 10:08 PM

On Wed, 30 Apr 2008 16:48:13 +0000, Donkey Hot wrote:

> package confusing;
> 
> public class Main
> {
>     public static void main(String[] args) {
>         String blank = "            ";
>         String sample = "bb bb bb";
> 
>         System.out.println(blank.substring(0,
>     	    	blank.length() - sample.length()) + sample);
>     }
> }


I don't think that this will meet the requirements of the assignment, not 
all of which are (probably) stated.

I bet that there needs to be a loop of some sort, probably nested, and 
some arrays.  Perhaps an array of Strings?  As the array is iterated, 
depending on the index, the printing is different.


-Nick
 




 13 Posts in Topic:
How can I write right-justified into a 12 chars width field?
gremlin@[EMAIL PROTECTED]  2008-04-29 18:23:11 
Re: How can I write right-justified into a 12 chars width field?
Lord Zoltar <lord.zolt  2008-04-29 11:30:08 
Re: How can I write right-justified into a 12 chars width field?
Mark Space <markspace@  2008-04-29 14:03:30 
Re: How can I write right-justified into a 12 chars width field?
Knute Johnson <nospam@  2008-04-29 14:42:26 
Re: How can I write right-justified into a 12 chars width field?
=?ISO-8859-1?Q?Arne_Vajh=  2008-04-29 19:12:28 
Re: How can I write right-justified into a 12 chars width field?
Christian <fakemail@[E  2008-04-30 01:42:37 
Re: How can I write right-justified into a 12 chars width field?
Chase Preuninger <chas  2008-04-29 18:25:40 
Re: How can I write right-justified into a 12 chars width field?
petersprc <petersprc@[  2008-04-29 19:13:04 
Re: How can I write right-justified into a 12 chars width field?
Andrea Francia <andrea  2008-04-30 21:11:43 
Re: How can I write right-justified into a 12 chars width field?
alexandre_paterson@[EMAIL  2008-04-29 20:21:46 
Re: How can I write right-justified into a 12 chars width field?
Roedy Green <see_websi  2008-04-30 05:04:11 
Re: How can I write right-justified into a 12 chars width field?
Donkey Hot <spam@[EMAI  2008-04-30 16:48:13 
Re: How can I write right-justified into a 12 chars width field?
thufir <hawat.thufir@[  2008-04-30 22:08:33 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 14:45:49 CST 2008.