 | selectSelectT, R Method (IListT, FuncT, R, FuncR, T) |
Get a 1-1 invertible mapping of an
IListT.
Namespace:
WhetStone.Looping
Assembly:
WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntaxpublic 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:
IListRA 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).
RemarksAlongside allowing mutating
this, the return value can optimize some methods:
Examplesvar arr = range.IRange(-850,5000,9)
var range+1 = arr.Select(a=>a+1,b=>b-1)
negPrimes.Contains(-53)
See Also