TEnumerable.Zip<TFirst,TSecond,TResult> Method
Overloads
| Zip<TFirst,TSecond>(IEnumerable<TFirst>, IEnumerable<TSecond>) |
Produces a sequence of tuples with elements from the two specified sequences. |
| Zip<TFirst,TSecond,TResult>(IEnumerable<TFirst>, IEnumerable<TSecond>, Func<TFirst,TSecond,TResult>) |
Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results. |
Produces a sequence of tuples with elements from the two specified sequences.
class function Zip<TFirst,TSecond>(const first: IEnumerable<TFirst>; const second: IEnumerable<TSecond>): IEnumerable<Tuple<TFirst, TSecond>>
Type Parameters
- TFirst
The type of the elements of the first input sequence.
- TSecond
The type of the elements of the second input sequence.
Parameters
- first
- IEnumerable<TFirst>
The first sequence to merge.
- second
- IEnumerable<TSecond>
The second sequence to merge.
Returns
A sequence of tuples with elements taken from the first and second sequences, in that order.
Exceptions
first or second is nil .
Zip<TFirst,TSecond,TResult>(IEnumerable<TFirst>, IEnumerable<TSecond>, Func<TFirst,TSecond,TResult>)
Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results.
class function Zip<TFirst,TSecond,TResult>(const first: IEnumerable<TFirst>; const second: IEnumerable<TSecond>; const resultSelector: Func<TFirst, TSecond, TResult>): IEnumerable<TResult>
Type Parameters
- TFirst
The type of the elements of the first input sequence.
- TSecond
The type of the elements of the second input sequence.
- TResult
The type of the elements of the result sequence.
Parameters
- first
- IEnumerable<TFirst>
The first sequence to merge.
- second
- IEnumerable<TSecond>
The second sequence to merge.
- resultSelector
- Func<TFirst, TSecond, TResult>
A function that specifies how to merge the elements from the two sequences.
Returns
A sequence that contains merged elements of two input sequences.
Exceptions
first or second or resultSelector is nil .