StringTokenizer   JAVA


Summary

The string tokenizer class allows an application to break a string into tokens.


StringTokenizer(String str)
StringTokenizer(String str, String delim)
StringTokenizer(String str, String delim, boolean returnDelims)

import java.util.StringTokenizer;

public class Test {
	public static void main(String[] args) {
		StringTokenizer st = new StringTokenizer("a|b|c", "|");
		while(st.hasMoreTokens()){
				System.out.println(st.nextToken());
			}
		}
	}
}


Result

a
b
c

References


Tags

# join  #array  #explode  #split  #stringtokenizer  #tokenizer 


[ Edit (Author only) ]