separatedBy method

Iterable<T> separatedBy(
  1. T separator
)

Implementation

Iterable<T> separatedBy(T separator) sync* {
  if (isEmpty) {
    return;
  }

  yield first;

  for (final item in tail) {
    yield separator;
    yield item;
  }
}