code: public static <C extends Collection<String>> C splitString(String line, int begin, int end, char delim, C words) {
  		int pos = begin;
  		while (pos < end) {
  			int start = pos;
  			pos = line.indexOf(delim, pos);
  			if(pos == -1 || pos > end) pos = end;
  			words.add(line.substring(start, pos));
  			pos++;
  		}
  		// If ending in a delimeter, add the empty string
  		if(end>begin && line.charAt(end-1)==delim) words.add("");
  		return words;
  	}
docs: Splits a string on the given delimiter over the given range.
  Does include all empty elements on the split.
  
  @param  words  the words will be added to this collection.
  
  @return  the collection provided in words parameter