【发布时间】:2020-07-22 06:26:51
【问题描述】:
我想从hs2 中删除所有出现在hs1 中的项目。
HashSet<string> hs1 = ...;
HashSet<string> hs2 = ...;
例如
hs1 = {"a","b","c"}
hs2 = {"a","d","e","f","b"}
那么我希望hs2 成为:
hs2 = {"d","e","f"}
我需要类似的东西:
hs2 = hs2.Remove('all items that exists in hs1...');
【问题讨论】:
-
这能回答你的问题吗? Remove items from one list in another