Method InPairs
InPairs<T, TOut>(IEnumerable<T>, Func<T, T, TOut>)
Enumerates a sequence in pairs
Declaration
public static IEnumerable<TOut> InPairs<T, TOut>(this IEnumerable<T> source, Func<T, T, TOut> join)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | source | An System.Collections.Generic.IEnumerable<T> to enumerate in pairs. |
Func<T, T, TOut> | join | A function that is invoked for each pair of elements. |
Returns
Type | Description |
---|---|
IEnumerable<TOut> | A new System.Collections.Generic.IEnumerable<T> containing the results from each pair. |
Type Parameters
Name | Description |
---|---|
T | The type of the elements of |
TOut | The type of the elements returned from |
Remarks
In the case of an uneven amount of elements, the list call to join
pases
default(T)
as the second parameter.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|