Click or drag to resize

selectSelectT, R Method (IListT, FuncT, R, FuncR, T)

Namespace:  WhetStone.Looping
Assembly:  WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntax
C#
public static IList<R> Select<T, R>(
	this IList<T> this,
	Func<T, R> selector,
	Func<R, T> inverse
)

Parameters

this
Type: System.Collections.GenericIListT
The IListT to map.
selector
Type: SystemFuncT, R
The mapping function.
inverse
Type: SystemFuncR, T
The inverse of selector.

Type Parameters

T
The type of the original IListT.
R
The type of the returned IListT.

Return Value

Type: IListR
A mutability passing IListT with selector applied on this's elements.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IListT. 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).
Remarks
Alongside allowing mutating this, the return value can optimize some methods:
Examples
var arr = range.IRange(-850,5000,9) //immutable, but searching is an O(1) operation.
var range+1 = arr.Select(a=>a+1,b=>b-1)
negPrimes.Contains(-53) //will perform O(1) operation, searching for -54 in an IRange.
See Also