ISet<T>.UnionWith(IEnumerable<T>) 方法

定义

修改当前集,使该集包含存在于当前集、指定集合或两者中的所有元素。Modifies the current set so that it contains all elements that are present in the current set, in the specified collection, or in both.

public:
 void UnionWith(System::Collections::Generic::IEnumerable<T> ^ other);
public void UnionWith (System.Collections.Generic.IEnumerable<T> other);
abstract member UnionWith : seq<'T> -> unit
Public Sub UnionWith (other As IEnumerable(Of T))

参数

other
IEnumerable<T>

要与当前集进行比较的集合。The collection to compare to the current set.

例外

othernullother is null.

注解

中的任何重复元素 other 都将被忽略。Any duplicate elements in other are ignored.

适用于