Zip<TSecond, TResult> method

Enumerable<TResult> Zip <TSecond, TResult>(Iterable<TSecond> other, ZipSelector<T, TSecond, TResult> selector)

Combines the values of the enumerable and another collection into an enumerable of new values.

During iteration, each element in the enumerable is passed to the selector function along with the element in the given other collection at the corresponding position. The returned value of the selector function is then returned. If either the enumerable's or the other collection's iteration reaches the end of its elements, iteration is stopped.

The length of the resulting enumerable will be equal to the lesser of the lengths of the source enumerable or the given other collection.

Implementation

Enumerable<TResult> Zip<TSecond, TResult>(
    Iterable<TSecond> other, ZipSelector<T, TSecond, TResult> selector) {
  return ZipEnumerable<T, TSecond, TResult>(this, other, selector);
}