Java CSV from ListtoCSV(List thelist, String sep)

Here you can find the source of ListtoCSV(List thelist, String sep)

Description

Listto CSV

License

Open Source License

Declaration

static public String ListtoCSV(List<String> thelist, String sep) 

Method Source Code

//package com.java2s;
//   Licensed under the Apache License, Version 2.0 (the "License"); you may

import java.util.List;

public class Main {
    static public String ListtoCSV(List<String> thelist, String sep) {
        if (thelist.isEmpty())
            return "";
        StringBuilder sb = new StringBuilder();
        for (Object obj : thelist) {
            sb.append(obj.toString());//from w  w w .  j  av a 2  s. com
            sb.append(sep);
        }
        return sb.substring(0, sb.toString().length() - sep.length());
    }
}

Related

  1. getStringListFromCsv(String tags)
  2. getVendorIdsAndNames(String vendorCsv, List vendorNames, List vendorIDs)
  3. listToCsv(List list)
  4. listToCsv(List listOfStrings, char separator)
  5. listToCsv(List strs)
  6. listToCSVString(List list)
  7. listToCsvTags(List tagsList)
  8. parseCSVList(String csv)
  9. parseCsvList(String csvList)