List of utility methods to do CSV from
List | getStringList(String csv) get String List String[] eqArr = csv.split(","); List<String> subStringList = new ArrayList<String>(); for (int i = 0; i < eqArr.length; i++) { String eqString = eqArr[i].trim(); subStringList.add(eqString); return subStringList; |
List | getStringListFromCsv(String tags) get String List From Csv return Arrays.asList(tags.split("\\s*,\\s*")); |
void | getVendorIdsAndNames(String vendorCsv, List get Vendor Ids And Names if (vendorCsv != null && vendorCsv.length() > 0) { vendorNames.add(vendorCsv); if (mapVendorNameToVendorId != null && mapVendorNameToVendorId.size() > 0) { vendorIDs.add(mapVendorNameToVendorId.get(vendorCsv)); |
String | listToCsv(List> list) Converts a List of objects to a comma separated string of the objects' string representations in the order given by the List's iterator. StringBuffer sb = new StringBuffer(); for (Iterator<?> iter = list.iterator(); iter.hasNext();) { sb.append(iter.next().toString()); if (iter.hasNext()) { sb.append(','); return sb.toString(); ... |
String | listToCsv(List To convert list to separated value StringBuilder sb = new StringBuilder(); for (int i = 0; i < listOfStrings.size() - 1; i++) { sb.append(listOfStrings.get(i)); sb.append(separator); if (listOfStrings.size() > 0) { sb.append(listOfStrings.get(listOfStrings.size() - 1)); return sb.toString(); |
String | listToCsv(List list To Csv return doListToCsv(strs);
|
String | ListtoCSV(List Listto CSV if (thelist.isEmpty()) return ""; StringBuilder sb = new StringBuilder(); for (Object obj : thelist) { sb.append(obj.toString()); sb.append(sep); return sb.substring(0, sb.toString().length() - sep.length()); ... |
String | listToCSVString(List list) Returns a CSV list from the elements of a List if (list == null) { return ""; String result = ""; for (int i = 0; i < list.size(); i++) { result += (i > 0 ? "," : "") + list.get(i).toString(); return result; ... |
String | listToCsvTags(List Converts a List of tags to a comma separated list String tags = ""; if (tagsList.size() > 0) { for (int i = 0; i < tagsList.size(); i++) { tags += tagsList.get(i); if (i != tagsList.size() - 1) { tags += ","; return tags; |
List | parseCSVList(String csv) parse CSV List if (csv == null) { return null; if (csv.isEmpty()) { return Collections.emptyList(); return new ArrayList<String>(Arrays.asList(csv.split(","))); |