/* TestToken.java CIS 160 David Klick 2005-05-23 Simple demonstration of StringTokenizer. */ import java.util.Scanner; import java.util.StringTokenizer; public class TestToken { public static void main(String[] args) { String delims = "- !~{}[]()*&^%$#@<>,.;':\"\\|/_+="; Scanner kbd = new Scanner(System.in); System.out.print("Enter a line of text: "); String s = kbd.nextLine(); StringTokenizer tok = new StringTokenizer(s, delims); while (tok.hasMoreTokens()) { System.out.println(tok.nextToken()); } } }