Wednesday, 7 June 2017

String Tokenization in java using Stringtokenizer class with example

To perform tokenization in java is pretty easy.

Suppose we want to tokenize this sentence"I am going to delhi". And we want output like as follow:
I
am
going
to
delhi

The code is;

String s="I am going to delhi";
StringTokenizer st = new StringTokenizer(s);
    while (st.hasMoreTokens()) 
{
  System.out.println(st.nextToken())
 }


See also:

No comments:

Post a comment

All about journals and research paper | What is impact factor? | how the impact factor is calculated? | who calculate the impact factor? Scopous journals

Figure 1: One of my Research Papers When the Scholars are in their Master or PhD or in any research field. They are supposed to writ...