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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s