Android examples for java.lang:String Split
Split String To List with default separator
import java.util.ArrayList; import java.util.List; public class Main { public static List<String> parseStringToList(String srcString, String split) { List<String> list = null; if (split == null) { split = ","; }//from w ww . j a v a2s .co m String[] strArr = srcString.split(split); if (strArr != null && strArr.length > 0) { list = new ArrayList<String>(strArr.length); for (String str : strArr) { list.add(str); } } return list; } }