Here you can find the source of getListFromCSVString(String csvString)
public static List<String> getListFromCSVString(String csvString)
//package com.java2s; import java.util.Arrays; import java.util.List; public class Main { public static List<String> getListFromCSVString(String csvString) { String[] returnArray = new String[0]; if (!isNullOrEmpty(csvString)) { String[] splitIt = csvString.split(","); returnArray = splitIt;//from www . j a v a2 s . c o m if (splitIt.length > 0) { returnArray = new String[splitIt.length]; int i = 0; for (String b : splitIt) returnArray[i++] = b.trim(); } } return Arrays.asList(returnArray); } public static final boolean isNullOrEmpty(String s) { if (s != null && !s.isEmpty()) return false; return true; } }