public static List<String> split(String str,String delim){
  List<String> splitList=null;
  StringTokenizer st=null;
  if (str == null)   return splitList;
  if (delim != null)   st=new StringTokenizer(str,delim);
 else   st=new StringTokenizer(str);
  if (st != null && st.hasMoreTokens()) {
    splitList=new LinkedList<String>();
    while (st.hasMoreTokens())     splitList.add(st.nextToken());
  }
  return splitList;
}

public static List < String > split ( String str , String delim ) { List < String > splitList = null ; StringTokenizer st = null ; if ( str == null ) return splitList ; if ( delim != null ) st = new StringTokenizer ( str , delim ) ; else st = new StringTokenizer ( str ) ; if ( st != null && st . hasMoreTokens ( ) ) { splitList = new LinkedList < String > ( ) ; while ( st . hasMoreTokens ( ) ) splitList . add ( st . nextToken ( ) ) ; } return splitList ; }
splits a string on a delimiter into a list of strings .
