Java CSV from csvToList(String csv)

Here you can find the source of csvToList(String csv)

Description

converts a string with comma separated values to a List of Strings

License

Apache License

Parameter

Parameter Description
csv comma separated values

Return

List of Strings

Declaration

public static List<String> csvToList(String csv) 

Method Source Code

//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));
    }
}

Related

  1. convertStringListToCSV(List source)
  2. countMaxColumnSizeByArray(List csvs)
  3. csv2list(String csvString)
  4. csvList(String _text, Integer[] _idx_ret)
  5. csvTagsToList(String tags)
  6. csvToList(String csv)
  7. CSVToList(String str)
  8. formatAsCsv(List stringList)
  9. formatCsvRecord(List csvRecord, char csvSeparator)