Collection<T>.IList.Contains(Object) 方法

定义

确定 IList 是否包含特定值。Determines whether the IList contains a specific value.

 virtual bool System.Collections.IList.Contains(System::Object ^ value) = System::Collections::IList::Contains;
bool IList.Contains (object value);
Function Contains (value As Object) As Boolean Implements IList.Contains

参数

value
Object

要在 Object 中查找的 IListThe Object to locate in the IList.

返回

如果在 true 中找到了该Object,则为 IList;否则为 falsetrue if the Object is found in the IList; otherwise, false.

实现

异常

value 是一个无法赋值给 IList 的类型。value is of a type that is not assignable to the IList.

注解

此方法通过首先确定 value 是类型 T (或 null),然后调用 Contains来确定相等性。This method determines equality by first determining whether value is of type T (or null) and then calling Contains.

此方法是一个 O (n)操作,其中 nCount的。This method is an O(n) operation, where n is Count.

适用于