private static List < String > splitToList ( String str , String delimiter ) { ArrayList < String > list = new ArrayList < String > ( ) ; StringTokenizer st = new StringTokenizer ( str , delimiter ) ; while ( st . hasMoreElements ( ) ) { list . add ( st . nextToken ( ) ) ; } return list ; }
Split a delimiter separated string into an ArrayList