Java CSV from getCSVFromList(List myList)

Here you can find the source of getCSVFromList(List myList)

Description

get CSV From List

License

Open Source License

Declaration

static public String getCSVFromList(List<String> myList) 

Method Source Code

//package com.java2s;

import java.util.List;
import java.util.Iterator;

public class Main {
    static public String getCSVFromList(List<String> myList) {
        String output = null;//from ww w.j  a va 2 s.  co m
        Iterator<String> iter = myList.iterator();
        while (iter.hasNext()) {

            String curVal = (String) iter.next();
            if (null == output) {
                output = curVal;
            } else {
                output = output + "," + curVal;
            }

        }
        if (null == output) {
            return "";
        }
        return output;
    }
}

Related

  1. formatCsvRecord(List csvRecord, char csvSeparator)
  2. getArrayListFromCSV(String csvString)
  3. getAsCsv(List tags)
  4. getCSV(List l)
  5. getCSVFromList(List myList)
  6. getCSVList(String csvList)
  7. getCSVList(String csvList)
  8. getCSVString(List items)
  9. getCsvStringsFromList(final List stringsToDelimit)