MoreEnumerableGenerateByIndexTResult Method

Returns a sequence of values based on indexes.

Definition

Namespace: MoreLinq
Assembly: MoreLinq (in MoreLinq.dll) Version: 3.4.0+b99a6a8cc504caf2d48372fe54a2f8116c59cd0c
C#
public static IEnumerable<TResult> GenerateByIndex<TResult>(
	Func<int, TResult> generator
)

Parameters

generator  FuncInt32, TResult
Generation function to apply to each index.

Type Parameters

TResult
The type of the value returned by generator and therefore the elements of the generated sequence.

Return Value

IEnumerableTResult
A sequence of generated results.

Remarks

The sequence is (practically) infinite where the index ranges from zero to MaxValue inclusive.

This function defers execution and streams the results.

See Also