Java examples for Language Basics:StringTokenizer
StringTokenizer - Return Delimiters along with Tokens
import java.util.StringTokenizer; public class Main { public static void main(String[] args) { StringTokenizer st = new StringTokenizer("Java|StringTokenizer|Example 1","|"); while(st.hasMoreTokens()) System.out.println(st.nextToken("|")); }/*www .j av a 2 s. c om*/ }