collectionToDelimitedString static method

String collectionToDelimitedString(
  1. Iterable? collection,
  2. String delimiter, [
  3. String prefix = '',
  4. String suffix = '',
])

Convert collection to delimited string

Implementation

static String collectionToDelimitedString(
  Iterable? collection,
  String delimiter, [
  String prefix = '',
  String suffix = ''
]) {
  if (collection == null || collection.isEmpty) return '';
  return collection.map((e) => '$prefix$e$suffix').join(delimiter);
}