Java CSV from getArrayListFromCSV(String csvString)

Here you can find the source of getArrayListFromCSV(String csvString)

Description

get Array List From CSV

License

Open Source License

Declaration

static public ArrayList<String> getArrayListFromCSV(String csvString) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.Arrays;

public class Main {
    static final public String CSV_SEPARATOR = ",";

    static public ArrayList<String> getArrayListFromCSV(String csvString) {
        return helper1(csvString, CSV_SEPARATOR);
    }/*  ww w  .j a v a  2s .c o m*/

    static private ArrayList<String> helper1(String ssvString, String separator) {
        if (ssvString.isEmpty())
            return new ArrayList<>(); // Return list with 0 elements as it should be!
        return new ArrayList<String>(Arrays.asList(ssvString.split(separator)));
    }
}

Related

  1. csvToList(String csv)
  2. csvToList(String csv)
  3. CSVToList(String str)
  4. formatAsCsv(List stringList)
  5. formatCsvRecord(List csvRecord, char csvSeparator)
  6. getAsCsv(List tags)
  7. getCSV(List l)
  8. getCSVFromList(List myList)
  9. getCSVFromList(List myList)