praveen

stringtokenize

Oct 19th, 2011
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class StringTokenizing{
  4.   public static void main(String[] args)
  5.  {
  6.   StringTokenizer stringTokenizer = new
  7.    StringTokenizer("You are tokenizing a string");
  8.   System.out.println("The total no. of tokens
  9.   generated :  " + stringTokenizer.countTokens());
  10.   while(stringTokenizer.hasMoreTokens()){
  11.   System.out.println(stringTokenizer.nextToken());
  12.   }
  13.   }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment