 | selectSelectT, R Method (ICollectionT, FuncT, R, FuncR, T) |
Namespace:
WhetStone.Looping
Assembly:
WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntaxpublic static ICollection<R> Select<T, R>(
this ICollection<T> this,
Func<T, R> selector,
Func<R, T> inverse
)
Parameters
- this
- Type: System.Collections.GenericICollectionT
The ICollectionT 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 ICollectionT.
- R
- The type of the returned ICollectionT.
Return Value
Type:
ICollectionRA mutability passing
ICollectionT 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
ICollectionT. 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