*
This commit is contained in:
1 parent
db1b6a5670
commit
3af26fbd3e
4 files changed
+39
-33
No files matched your search
@@ -328,6 +328,12 @@ public static class EnumerableExtensions {
|
||||
foreach (var item in itemsToRemove) source.Remove(item);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从集合中移除指定元素。
|
||||
/// </summary>
|
||||
public static IEnumerable<T> Except<T>(this IEnumerable<T> source, T element)
|
||||
=> source.Except([element]);
|
||||
|
||||
/// <summary>
|
||||
/// 判断集合是否有且仅有一个元素。
|
||||
/// 在输入 null 时返回 false。
|
||||
|
||||
Reference in new issue
Block a user