This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String convertListToCsv(List<String> listToConvert) { | |
String commaSeparatedValues = ""; | |
//Iterate through the list and append comma after each values | |
Iterator<String> iter = listToConvert.iterator(); | |
while (iter.hasNext()) { | |
commaSeparatedValues += iter.next() + ","; | |
} | |
//Remove the last comma | |
if (commaSeparatedValues.endsWith(",")) { | |
commaSeparatedValues = commaSeparatedValues.substring(0, |
NewerOlder