Creates an array from an
IEnumerableTwhere a function is used to determine the index at which an element will be placed in the array. The elements are projected into the array via an additional function.
Namespace: MoreLinqMoreLinq (in MoreLinq.dll) Version: 3.0.0
Syntaxpublic static TResult[] ToArrayByIndex<T, TResult>( this IEnumerable<T> source, Func<T, int> indexSelector, Func<T, int, TResult> resultSelector )
<ExtensionAttribute> Public Shared Function ToArrayByIndex(Of T, TResult) ( source As IEnumerable(Of T), indexSelector As Func(Of T, Integer), resultSelector As Func(Of T, Integer, TResult) ) As TResult()
public: [ExtensionAttribute] generic<typename T, typename TResult> static array<TResult>^ ToArrayByIndex( IEnumerable<T>^ source, Func<T, int>^ indexSelector, Func<T, int, TResult>^ resultSelector )
[<ExtensionAttribute>] static member ToArrayByIndex : source : IEnumerable<'T> * indexSelector : Func<'T, int> * resultSelector : Func<'T, int, 'TResult> -> 'TResult[]Parameters
Type:
TResultAn array that contains the projected elements from the input sequence. The size of the array will be as large as the highest index returned by the
indexSelectorplus 1.
Usage NoteIn Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic)or
Extension Methods (C# Programming Guide).
RemarksThis method forces immediate query evaluation. It should not be used on infinite sequences. If more than one element maps to the same index then the latter element overwrites the former in the resulting array.
See AlsoRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4