import java.util.StringTokenizer; /** Prints the tokens resulting from treating the first * command-line argument as the string to be tokenized * and the second as the delimiter set. */ public class TokTest { public static void main(String[] args) { if (args.length == 2) { String input = args[0], delimiters = args[1]; StringTokenizer tok = new StringTokenizer(input, delimiters); while (tok.hasMoreTokens()) System.out.println(tok.nextToken()); } else System.out.println ("Usage: java TokTest string delimiters"); } }