CollectionExtensions.

RemoveAll<T>(ICollection<T>, Func<T, bool>) Method

Summary

Removes all items that match a predicate from a collection.
Assembly
Wyam.Common.dll
Namespace
Wyam.Common.Util
Containing Type
CollectionExtensions

Syntax

public static int RemoveAll<T>(this ICollection<T> collection, Func<T, bool> match)

Type Parameters

Name Description
T The type of the collection items.

Parameters

Name Type Description
collection ICollection<T> The collection to remove items from.
match Func<T, bool> The predicate (return true to remove the item).

Return Value

Type Description
int The number of items removed.
GitHub