|
|
|
@ -37,6 +37,13 @@ namespace System.Collections.Generic
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Removed all items from a collection those satisfy the given <paramref name="predicate"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T">Type of the items in the collection</typeparam>
|
|
|
|
|
/// <param name="source">The collection</param>
|
|
|
|
|
/// <param name="predicate">The condition to remove the items</param>
|
|
|
|
|
/// <returns>List of removed items</returns>
|
|
|
|
|
public static IList<T> RemoveAll<T>([NotNull] this ICollection<T> source, Func<T, bool> predicate)
|
|
|
|
|
{
|
|
|
|
|
var items = source.Where(predicate).ToList();
|
|
|
|
|