Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: IEnumerable<TResult> SelectConsecutivePairs<T, TResult>(this IEnumerable<T>, bool, Func<T, T, TResult>)

Declaration

public static IEnumerable<TResult> SelectConsecutivePairs<T, TResult>(
    this IEnumerable<T> source,
    bool closed,
    Func<T, T, TResult> selector
)

Summary

Enumerates all consecutive pairs of the elements.

Generic type parameters

TThis type parameter is not documented.
TResultThis type parameter is not documented.

Parameters

this IEnumerable<T>source The input enumerable.
boolclosed If true, an additional pair containing the last and first element is included. For example, if the source collection contains { 1, 2, 3, 4 } then the enumeration contains { (1, 2), (2, 3), (3, 4) } if closed is false, and { (1, 2), (2, 3), (3, 4), (4, 1) } if closed is true.
Func<T, T, TResult>selector The selector function to run each consecutive pair through.