private static String[] split(String data, String splits, boolean trim) {
    // System.out.println("Split called: '" + data + "' <?> " + splits);
    Vector strings = new Vector();
    int lastPos = 0;
    int mode = 0;
    for (int i = 0, n = data.length(); i < n; i++) {
      char c = data.charAt(i);
      if (splits.indexOf(c) != -1) {
	if (mode == 0) {
	  if (lastPos != 0 && ((lastPos + 1) < n))
	    lastPos++;
	  strings.addElement(data.substring(lastPos, i));
	}
	lastPos = i;
	mode = 1;
      } else {
	mode = 0;
      }
    }
    if (lastPos != 0 && lastPos + 1 < data.length())
      lastPos++;
    strings.addElement(data.substring(lastPos, data.length()));

    String[] retval = new String[strings.size()];
    for (int i = 0, n = retval.length; i < n; i++) {
      retval[i] = (String) strings.elementAt(i);
    }
    return retval;
  }