Click or drag to resize

MoreEnumerableGenerateByIndexTResult Method

Returns a sequence of values based on indexes.

Namespace:  MoreLinq
Assembly:  MoreLinq (in MoreLinq.dll) Version: 3.3.1+b77df70598ab84c28cd43dcf74594024b6d575e1
Syntax
public static IEnumerable<TResult> GenerateByIndex<TResult>(
	Func<int, TResult> generator
)

Parameters

generator
Type: SystemFuncInt32, 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

Type: 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