Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: IEnumerable<IEnumerable<T>> Subsequences<T>(this IEnumerable<T>, int, int?)

Declaration

public static IEnumerable<IEnumerable<T>> Subsequences<T>(
    this IEnumerable<T> source,
    int minLength = 0,
    int? maxLength = null
)

Summary

Returns all subsequences of the specified lengths of the input IEnumerable<T>.

Generic type parameters

TThis type parameter is not documented.

Parameters

this IEnumerable<T>source The sequence of items to generate subsequences of.
intminLength The minimum length of a subsequence to return. Must be between 0 and the length of the input collection.
int?maxLength The maximum length of a subsequence to return. Must be between 0 and the length of the input collection. If null is specified, the size of the input collection is used.

Returns

A collection containing all matching subsequences of the input IEnumerable<T>.