List of utility methods to do CSV from
String | toCsvString(List to Csv String if (values == null || values.isEmpty()) return ""; StringBuilder builder = new StringBuilder(); for (String value : values) builder.append(value).append(','); builder.deleteCharAt(builder.length() - 1); return builder.toString(); |
String | toCsvString(List to Csv String String csvString = toDelimitedString(values, ",", true); return csvString; |
String | toCSVString(List to CSV String StringBuilder sb = new StringBuilder(); if (values.size() != quoteColumn.length) { throw new IllegalArgumentException("values and quoteColumn must have the same lengths!"); int valsize = values.size(); for (int i = 0; i < valsize; i++) { String s = values.get(i); if (quoteColumn[i]) { ... |
List | toObjectList(String csvString) Splits a coma separated list of strings, into an array. if (csvString == null || csvString.isEmpty()) return new ArrayList<String>(); return Arrays.asList(csvString.split(",")); |