MapIndexed
Builds a new collection whose elements are the results of applying the given mapping
function to each of the elements of the collection.
The integer index passed to the function indicates the index (from 0) of element being transformed.
Parameters
Returns
Func<int, T, TResult> mapping
IEnumerable<T> source
IEnumerable<TResult>
Usage
Multiplying elements by its respectively index
Creating a tuple with index and value
Last updated
Was this helpful?