Java CSV from getListFromCSV(String myCsv)

Here you can find the source of getListFromCSV(String myCsv)

Description

Convert the command seperated values to a list

License

Open Source License

Parameter

Parameter Description
myCsv comma seperated values to convert to a list

Return

List the values that taht where derived from the the command seperated values

Declaration

public static List<String> getListFromCSV(String myCsv) 

Method Source Code


//package com.java2s;
import java.util.List;

import java.util.ArrayList;

public class Main {
    /**//  w ww  .ja  v a  2  s  .  com
     * Convert the command seperated values to a list
     * @param myCsv comma seperated values to convert to a list
     * @return List the values that taht where derived from the
     * the command seperated values
     */
    public static List<String> getListFromCSV(String myCsv) {
        if (null == myCsv)
            return null;
        List<String> output = new ArrayList();
        String[] fields = myCsv.split(",");
        for (int i = 0; i < fields.length; i++) {
            output.add(fields[i]);
        }
        return output;
    }
}

Related

  1. getCSVList(String csvList)
  2. getCSVString(List items)
  3. getCsvStringsFromList(final List stringsToDelimit)
  4. getepcList(String csv)
  5. getFixedArrayListSizeFromCSV(String csvString, int returnArrayListSize)
  6. getListFromCSV(String myCsv)
  7. getListFromCSVString(String csvString)
  8. getPrintableCSVs(List list)
  9. getRightFirstRow(List csvRows)