joinTo method

String joinTo(
  1. String f(
    1. E e
    ), {
  2. String separator = ",",
})

Implementation

String joinTo(String f(E e), {String separator = ","}) {
  var buffer = StringBuffer();
  for (int i = 0; i < this.length; i++) {
    var element = this.elementAt(i);
    buffer.write(f(element));
    if (i != this.length - 1) {
      buffer.write(separator);
    }
  }
  return buffer.toString();
}