Soldato
- Joined
- 14 Dec 2005
- Posts
- 12,488
- Location
- Bath
Hi guys,
I'm trying to do something in Java but aren't really sure how to do it.
I've got a char array that contains a word. What I'd like to do instead of the normal one character per line I'd like to increase the number of characters printed each time, until the whole word is printed out. I.E. the first time it prints out [0], then it prints [0] & [1], then it prints [0] & [1] & [2], etc.
Example (using Overclockers as the word):
O
Ov
Ove
Over
Overc
Overcl
Overclo
Overcloc
Overclock
Overclocke
Overclocker
Overclockers
Can anyone point me in the right direction? No doubt it'll be a For Loop that I'll understand when I see it, but I just can't think it up
.
I'm trying to do something in Java but aren't really sure how to do it.
I've got a char array that contains a word. What I'd like to do instead of the normal one character per line I'd like to increase the number of characters printed each time, until the whole word is printed out. I.E. the first time it prints out [0], then it prints [0] & [1], then it prints [0] & [1] & [2], etc.
Example (using Overclockers as the word):
O
Ov
Ove
Over
Overc
Overcl
Overclo
Overcloc
Overclock
Overclocke
Overclocker
Overclockers
Can anyone point me in the right direction? No doubt it'll be a For Loop that I'll understand when I see it, but I just can't think it up
