All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----jclass.util.JCStringTokenizer
It is similar to java.util.StringTokenizer, but delimiters can be included as literals by preceding them with a backslash character. It also fixes a known problem: if one delimiter immediately follows another, a null string is returned as the token instead of being skipped over. Example usage:
String token, s = "this, is, a,, test"; JCStringTokenizer st = new JCStringTokenizer(s); while (st.hasMoreTokens()) { token = st.nextToken(','); println(token); }This prints the following to the console:
this is a test
The delimeter can be "escaped" by a backslash character.
To include a backslash character, precede it by another backslash character.
public boolean strip_esc
public JCStringTokenizer(String s)
public String nextToken()
public String nextToken(char delim)
The delimeter can be "escaped" by a backslash character.
To include a backslash character, precede it by another backslash character.
public int countTokens(char delim)
public boolean hasMoreTokens()
public int getPosition()
All Packages Class Hierarchy This Package Previous Next Index