Here you can find the source of stringToList(String str)
protected static List<String> stringToList(String str)
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { protected static List<String> stringToList(String str) { List<String> list = new ArrayList<>(); if (str != null) { String tmp = str.replace('&', ','); String[] pieces = tmp.split(","); for (String piece : pieces) { String target = piece.trim(); if (target.length() > 0) { list.add(target);/* w w w . ja va 2 s . c om*/ } } } return list; } }