Here you can find the source of stringToList(String commaSeparatedList)
public static List<String> stringToList(String commaSeparatedList)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static List<String> stringToList(String commaSeparatedList) { ArrayList<String> list = new ArrayList<String>(); String[] preprocessedList = commaSeparatedList.split(","); for (String string : preprocessedList) { list.add(string.trim());//from ww w . j av a2 s.c o m } return list; } }