Here you can find the source of csvToList(String csv)
Parameter | Description |
---|---|
csv | comma separated values |
public static List<String> csvToList(String csv)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { public static final Character CSV_SEPARATOR = ','; /**//from w ww. java 2s .co m * converts a string with comma separated values to a List of Strings * * @param csv * comma separated values * @return List of Strings */ public static List<String> csvToList(String csv) { if (csv == null) { return new ArrayList<String>(); } return Arrays.asList(csv.split(CSV_SEPARATOR.toString(), -1)); } }