concatenateArray function

String concatenateArray(
  1. List<String> list
)

Convert list of strings to a string with commas

Implementation

String concatenateArray(List<String> list) {
  String output = '';

  for (final String item in list) {
    if (item == list.first) {
      output += item;
    } else {
      output += ',$item';
    }
  }

  return output;
}