Here you can find the source of stringToList(String listString, String delimiter)
public static List<String> stringToList(String listString, String delimiter)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static List<String> stringToList(String listString, String delimiter) {//from w w w . j ava2 s .co m ArrayList<String> result = new ArrayList<String>(); int last = -1; if (listString != null && !listString.isEmpty()) { while (listString.indexOf(delimiter, ++last) != -1) { result.add(listString.substring(last, listString.indexOf(delimiter, last))); last = listString.indexOf(delimiter, last); } result.add(listString.substring(last, listString.length())); } return result; } }