Why to use StringBuffer in Dart instead of Iterable.join?
There isn't a big difference. If you already have a list of strings, there is no difference in using StringBuffer.writeAll
or Iterable.join
. The Iterable.join
method uses a StringBuffer
internaly:
String join([String separator = ""]) {
StringBuffer buffer = new StringBuffer();
buffer.writeAll(this, separator);
return buffer.toString();
}
From the Dart documentation (click on the code button on the right).