Learning The "J"

Home » JAVA Learning » JAVA Core » String Tokenizer

Category Archives: String Tokenizer

Using String Tokenizer

import java.util.StringTokenizer;

class DemoStringTokenizer {
	static String in = "JAVA IS EASY TO LEARN I LOVE TO WORK IN IT";
	
	public static void main(String args[]) {
		StringTokenizer st = new StringTokenizer(in, " ");

		while(st.hasMoreTokens()) {
			System.out.println(st.nextToken());}
		}
	}
}