String Tokenizer

This post was moved to


String tokenizer has been made better in 1.5 when compared to the same in 1.2 version.

String tokenizer in 1.2:

String str = “Hello World”;
StringTokenizer st = new StringTokenizer();
while (st.hasMoreTokens()) {

String tokenizer in 1.5:

String str = “Hello World”;
String[] result = str.split(” “);
for (int x=0; x<result.length; x++)

The redundecy of using tokens has been eliminated in 1.5 inturn making our life easier.