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

定义

确定一个集是否为指定集合的子集。Determines whether a set is a subset of a specified collection.

public:
 bool IsSubsetOf(System::Collections::Generic::IEnumerable<T> ^ other);
public bool IsSubsetOf (System.Collections.Generic.IEnumerable<T> other);
abstract member IsSubsetOf : seq<'T> -> bool
Public Function IsSubsetOf (other As IEnumerable(Of T)) As Boolean

参数

other
IEnumerable<T>

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

返回

Boolean

如果当前集是 other 的子集,则为 true;否则为 falsetrue if the current set is a subset of other; otherwise, false.

例外

othernullother is null.

注解

如果 other 包含与当前集相同的元素,则当前集仍被视为另一个的子集。If other contains the same elements as the current set, the current set is still considered a subset of other.

false如果当前集包含不在中的元素,此方法将始终返回 otherThis method always returns false if the current set has elements that are not in other.

适用于