private static List < String > parseList ( String input , String delim ) { List < String > result = new ArrayList <> ( ) ; StringTokenizer st = new StringTokenizer ( input , delim ) ; while ( st . hasMoreTokens ( ) ) { String token = st . nextToken ( ) . trim ( ) ; if ( token . length ( ) > 0 ) { result . add ( token ) ; } } return result ; }
Create a List from a delimited string