Class TakeEveryExtensions
Linq extension to take every nth element of a sequence.
Inherited Members
Namespace: Firefly.EmbeddedResourceLoader
Assembly: Firefly.EmbeddedResourceLoader.dll
Syntax
public static class TakeEveryExtensions
Methods
| Improve this Doc View SourceTakeEvery<T>(IEnumerable<T>, Int32)
Takes every nth element from a sequence.
Declaration
public static IEnumerable<T> TakeEvery<T>(this IEnumerable<T> sequence, int every)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | sequence | The sequence. |
| Int32 | every | Number of elements to advance before taking another element. |
Returns
| Type | Description |
|---|---|
| IEnumerable<T> | New enumerable containing selected elements. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of sequence |
TakeEvery<T>(IEnumerable<T>, Int32, Int32)
Takes every nth element from a sequence.
Declaration
public static IEnumerable<T> TakeEvery<T>(this IEnumerable<T> sequence, int every, int skipInitial)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | sequence | The sequence. |
| Int32 | every | Number of elements to advance before taking another element. |
| Int32 | skipInitial | Number of elements to skip before beginning to take elements. |
Returns
| Type | Description |
|---|---|
| IEnumerable<T> | New enumerable containing selected elements. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of sequence |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | sequence is |
| ArgumentException | 'every' must be 1 or greater or 'skipInitial' must be 0 or greater |