Partition
Splits the collection into two collections, containing the elements for which the given predicate
returns true
and false
respectively.
Element order is preserved in both of the created collections.
Parameters
Returns
Func<T, bool> predicate
IEnumerable<T> source
(IEnumerable<T> Trues, IEnumerable<T> Falses)
Usage
Splitting even and odd numbers
Last updated
Was this helpful?