"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."
� weight[i].substring (0, len-3); is another idea that comes to mind - consult the api-doc for the right usage of the numeric parameters (from, to).
It is another diskussion, how many objects are created behind the scene by using ([Pattern/ Matcher], [replaceAll], [StringTokenizer]).
Create a program to compare these approaches, and increase the number of weights until the results differ significantly, but study techniques for microbenchmarks first, because it's easy to do it wrong.
Or analyze the sourcecode of ([Pattern/ Matcher], [replaceAll], [StringTokenizer]).
Don't forget to post the results. [ March 30, 2006: Message edited by: Stefan Wagner ]