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

定義

修改目前的資料集,使其僅包含同時也在指定之集合中出現的項目。Modifies the current set so that it contains only elements that are also in a specified collection.

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

參數

other
IEnumerable<T>

要與目前資料組比較的集合。The collection to compare to the current set.

例外狀況

othernullother is null.

備註

這個方法會忽略中的任何重複元素 otherThis method ignores any duplicate elements in other.

適用於