This site requires JavaScript, please enable it in your browser!
Greenfoot back
JasonZhu
JasonZhu wrote ...

2014/3/8

How improve a String related program

1
2
danpost danpost

2014/3/9

#
You could add a string of spaces after each word and then use the 'substring' method to make each string the same length. print ((word+" ").substring(0, 20) ); This assumes no word is greater than 20 characters long. Then you do not have to worry about indenting. I guess this assumes that your print is monospaced.
JasonZhu JasonZhu

2014/3/9

#
Thanks so much for all the help you provided me and putting up with me! You really are the best! :)
You need to login to post a reply.
1
2