public final CharSequence nextToken(CharSequence csq,char c){
  int n=csq.length();
  for (int i=index; i < n; i++) {
    if (csq.charAt(i) != c) {
      int j=i;
      for (; (++j < n) && (csq.charAt(j) != c); ) {
      }
      index=j;
      return csq.subSequence(i,j);
    }
  }
  index=n;
  return null;
}

public final CharSequence nextToken ( CharSequence csq , char c ) { int n = csq . length ( ) ; for ( int i = index ; i < n ; i ++ ) { if ( csq . charAt ( i ) != c ) { int j = i ; for ( ; ( ++ j < n ) && ( csq . charAt ( j ) != c ) ; ) { } index = j ; return csq . subSequence ( i , j ) ; } } index = n ; return null ; }
returns the subsequence from the specified cursor position not holding the specified character . for example : [ code ] charsequence csq = " this is a test " ; for ( charsequence token ; ( token = cursor . nexttoken ( csq , ' ' ) ) ! = null ; ) { system . out . println ( token ) ; / / prints one word at a time . } [ / code ]
