Java CSV from getListFromCSVString(String csvString)

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

Description

get List From CSV String

License

Open Source License

Declaration

public static List<String> getListFromCSVString(String csvString) 

Method Source Code

//package com.java2s;

import java.util.Arrays;

import java.util.List;

public class Main {
    public static List<String> getListFromCSVString(String csvString) {
        String[] returnArray = new String[0];
        if (!isNullOrEmpty(csvString)) {
            String[] splitIt = csvString.split(",");
            returnArray = splitIt;//from   www .  j a  v a2 s  .  c o  m
            if (splitIt.length > 0) {
                returnArray = new String[splitIt.length];
                int i = 0;
                for (String b : splitIt)
                    returnArray[i++] = b.trim();
            }
        }
        return Arrays.asList(returnArray);
    }

    public static final boolean isNullOrEmpty(String s) {
        if (s != null && !s.isEmpty())
            return false;
        return true;
    }
}

Related

  1. getCsvStringsFromList(final List stringsToDelimit)
  2. getepcList(String csv)
  3. getFixedArrayListSizeFromCSV(String csvString, int returnArrayListSize)
  4. getListFromCSV(String myCsv)
  5. getListFromCSV(String myCsv)
  6. getPrintableCSVs(List list)
  7. getRightFirstRow(List csvRows)
  8. getStringList(String csv)
  9. getStringListFromCsv(String tags)