View Single Post
Old 04-29-2004, 05:13 PM   #2 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,161
Belisarius is on a distinguished road
Would never be able to tell you came to Java from C . . .

The main problem is your for loop is wrong. You're checking to see it i > array.length, when it should be i < array.length.

Anyways, use StringTokenizer to do this, it'll save you a lot of work.
And don't use += with Strings, use StringBuffer. String concatination is very inefficent. Try concating a million strings together, then try it with StringBuffer, and you'll notice a big difference.
__________________
GitS
Belisarius is offline   Reply With Quote