import java.util.Vector; public class SplitString{ public String[] getList(String str, String delim) { String emp = new String(); if (emp.equals(str) || delim == null || delim.length() == 0) return new String[]{str}; Vector v = new Vector(); int pos = 0; int newpos = str.indexOf(delim, 0); while (newpos != -1) { v.addElement(str.substring(pos, newpos)); pos = newpos + delim.length(); newpos = str.indexOf(delim, pos); } v.addElement(str.substring(pos)); String[] s = new String[v.size()]; v.copyInto(s); return s; } }