Java examples for Language Basics:StringTokenizer
Use StringTokenizer to break a string into tokens.
import java.util.StringTokenizer; public class Main { public static void main(String[] args) { StringTokenizer st = new StringTokenizer("Java StringTokenizer Example"); //from ww w . ja va 2 s.co m while(st.hasMoreTokens()) System.out.println(st.nextToken()); } }