ICollection.RemoveAll
This commit is contained in:
1 parent
cf42cf19e3
commit
4309899c79
1 file changed
+7
@@ -318,6 +318,13 @@ public static class EnumerableExtensions {
|
||||
foreach (var item in itemsToRemove) source.Remove(item);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从集合中移除另一个集合中的所有元素。
|
||||
/// </summary>
|
||||
public static void RemoveAll<T>(this ICollection<T> source, IEnumerable<T> itemsToRemove) {
|
||||
foreach (var item in itemsToRemove) source.Remove(item);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 仅保留满足条件的元素,移除不满足条件的元素。
|
||||
/// </summary>
|
||||
|
||||
Reference in new issue
Block a user