Here you can find the source of strToList(String str, String split)
public static List<String> strToList(String str, String split)
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { public static List<String> strToList(String str, String split) { String[] strs = {};/*from www .java2 s . c om*/ if (str != null && !"".equals(str)) { strs = str.split(split); } List<String> tokenList = new ArrayList<String>(); for (int i = 0; i < strs.length; i++) { String temp = strs[i]; if (temp != null) { temp = strs[i].trim(); if (!"".equals(temp)) { tokenList.add(temp); } } } return tokenList; } }