Choose
Applies the given chooser
function to each element of the collection. Returns the collection comprised of the TResult
results for each element where the function returns an Option<T>.Some
.
This function works like a combination of Map
and Filter
.
Parameters
Returns
Func<T, Option<TResult>> chooser
IEnumerable<T> source
IEnumerable<TResult>
Usage
Choosing even numbers in a collection by using a named function
Choosing the square of odd numbers by using an anonymous function
Last updated
Was this helpful?