更新时间:2023-11-25 17:30:52
这就是设置的内容(例如, SetEquals
验证集合和另一个集合是否包含相同的元素.
That's what sets (e.g., HashSet<T>
) are for. Sets have no defined order, and SetEquals
verifies whether the set and another collection contain the same elements.
var set = new HashSet<int>(list1);
var equals = set.SetEquals(list2);