question: private String [ ] splitSeparator ( String sep , String s ) { Vector v = new Vector ( ) ; int tokenStart = 0 ; int tokenEnd = 0 ; while ( ( tokenEnd = s . indexOf ( sep , tokenStart ) ) != - 1 ) { v . addElement ( s . substring ( tokenStart , tokenEnd ) ) ; tokenStart = tokenEnd + 1 ; } v . addElement ( s . substring ( tokenStart ) ) ; String [ ] retVal = new String [ v . size ( ) ] ; v . copyInto ( retVal ) ; return retVal ; }
target:  Split a string based on the presence of a specified separator.  Returns an array of arbitrary length.  The end of each element in the array is indicated by the separator of the end of the string.  If there is a separator immediately before the end of the string, the final element will be empty.  None of the strings will contain the separator.  Useful when separating strings such as "foo/bar/bas" using separator "/".