code: public static String[] split(String input, String delimiters) {
          if (input.length() == 0 || delimiters.length() == 0) {
              return new String[]{input};
          }
  
          StringTokenizer tok = new StringTokenizer(input, delimiters);
          String[] array = new String[tok.countTokens()];
          int i = 0;
          while (tok.hasMoreTokens()) {
              array[i++] = tok.nextToken();
          }
          return array;
      }
docs: Splits a string into an array of substrings according to the semantics of <code>StringTokenizer</code>.
  If the input string is empty, a single element array containing an empty string is returned.
  If the delimiters are empty, a single element array containing the input string is returned.
  
  @param input      the string to split
  @param delimiters characters used to split the string
  @return an array of strings