code: public static String[] split(String s, char divider) {
          int last = 0;
          int i;
          ArrayList<String> output = new ArrayList<String>();
          for (i = 0; i < s.length(); ++i) {
              if (s.charAt(i) == divider) {
                  output.add(s.substring(last,i));
                  last = i+1;
              }
          }
          output.add( s.substring(last,i));
          return output.toArray(new String[output.size()]);
      }
docs: Split a string into pieces based on the given divider character
  @param s the string to split
  @param divider the character on which to split.  Occurrences of
  this character are not included in the output
  @return output an array to receive the substrings between
  instances of divider. Adjacent instances of the divider
  character will place empty strings into output.