code: public Collection<Text> split(char separator) {
          int pointer = pos;
          int limit = pos + len;
          int mark = pointer;
  
          ArrayList<Text> tokens = new ArrayList<Text>();
          while (pointer < limit) {
              if (chars[pointer] == separator) {
                  tokens.add(new Text(chars, mark, pointer - mark));
                  mark = pointer + 1;
              }
              pointer++;
          }
          
          tokens.add(new Text(chars, mark, limit - mark));        
          return tokens;
      }
docs: Splits text into partitions.
  
  @param separator character used for partitioning
  @return array of text strings.