StringCollection.IList.Contains(Object) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
确定元素是否在 StringCollection.
virtual bool System.Collections.IList.Contains(System::Object ^ value) = System::Collections::IList::Contains;
bool IList.Contains(object value);
abstract member System.Collections.IList.Contains : obj -> bool
override this.System.Collections.IList.Contains : obj -> bool
Function Contains (value As Object) As Boolean Implements IList.Contains
参数
- value
- Object
在 Object . 中查找的StringCollection 该值可以是 null。
返回
实现
注解
此方法通过调用 Object.Equals确定相等性。
此方法执行线性搜索;因此,此方法是 O(n) 操作,其中 n 。Count
此方法使用集合的对象 Equals 和 CompareTo 方法 item 来确定是否存在 item 。