MoreEnumerableGenerateByIndexTResult Method |
Returns a sequence of values based on indexes.
Namespace:
MoreLinq
Assembly:
MoreLinq (in MoreLinq.dll) Version: 2.1.0
Syntax public static IEnumerable<TResult> GenerateByIndex<TResult>(
Func<int, TResult> generator
)
Public Shared Function GenerateByIndex(Of TResult) (
generator As Func(Of Integer, TResult)
) As IEnumerable(Of TResult)
public:
generic<typename TResult>
static IEnumerable<TResult>^ GenerateByIndex(
Func<int, TResult>^ generator
)
static member GenerateByIndex :
generator : Func<int, 'TResult> -> IEnumerable<'TResult>
Parameters
- generator
- Type: SystemFuncInt32, TResult
Generation function to apply to each index
Type Parameters
- TResult
- Type of result to generate
Return Value
Type:
IEnumerableTResultA sequence
Remarks
The sequence is (practically) infinite
- the index ranges from 0 to int.MaxValue inclusive. This function defers
execution and streams the results.
See Also