public static List<String> split(String stringToSplit,String delimiter,boolean trim){
  if (stringToSplit == null) {
    return new ArrayList<String>();
  }
  if (delimiter == null) {
    throw new IllegalArgumentException();
  }
  StringTokenizer tokenizer=new StringTokenizer(stringToSplit,delimiter,false);
  List<String> splitTokens=new ArrayList<String>(tokenizer.countTokens());
  while (tokenizer.hasMoreTokens()) {
    String token=tokenizer.nextToken();
    if (trim) {
      token=token.trim();
    }
    splitTokens.add(token);
  }
  return splitTokens;
}

public static List < String > split ( String stringToSplit , String delimiter , boolean trim ) { if ( stringToSplit == null ) { return new ArrayList < String > ( ) ; } if ( delimiter == null ) { throw new IllegalArgumentException ( ) ; } StringTokenizer tokenizer = new StringTokenizer ( stringToSplit , delimiter , false ) ; List < String > splitTokens = new ArrayList < String > ( tokenizer . countTokens ( ) ) ; while ( tokenizer . hasMoreTokens ( ) ) { String token = tokenizer . nextToken ( ) ; if ( trim ) { token = token . trim ( ) ; } splitTokens . add ( token ) ; } return splitTokens ; }
splits stringtosplit into a list , using the given delimiter
