Here you can find the source of tokenizeCsv(String input)
public static final List<String> tokenizeCsv(String input)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { /** CSV config separator. */ private static final String COMMA = ","; public static final List<String> tokenizeCsv(String input) { List<String> result = new ArrayList<String>(); if (null != input && !input.isEmpty()) { String[] tokens = input.trim().split(COMMA); if (null != tokens && tokens.length > 0) { for (String token : tokens) { String sanitizedToken = token.trim(); if (!sanitizedToken.isEmpty()) { result.add(sanitizedToken); }/*from w ww . j a va2 s .co m*/ } } } return result; } }