edu.pdx.cs.joy.core.ParseString Maven / Gradle / Ivy
The newest version!
package edu.pdx.cs.joy.core;
import java.util.*;
/**
* This classes parses strings from the command line using a
* StringTokenizer
.
*/
public class ParseString {
/**
* The second String
from the command line contains the
* parsing delimiters.
*/
public static void main(String[] args) {
String string = args[0];
String delimit = args[1];
StringTokenizer st;
st = new StringTokenizer(string, delimit);
while (st.hasMoreTokens()) {
String token = st.nextToken();
System.out.println("Token: " + token);
}
}
}