StringCollection.IList.Contains(Object) 方法

定義

判斷某項目是否在 StringCollection 中。

 virtual bool System.Collections.IList.Contains(System::Object ^ value) = System::Collections::IList::Contains;
bool IList.Contains (object value);
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

要在 StringCollection 中尋找的 Object。 這個值可以是 null

傳回

如果在 true 中找到 value,則為 StringCollection,否則為 false

實作

備註

這個方法會呼叫 Object.Equals來判斷相等。

這個方法會執行線性搜尋;因此,這個方法是 O (n) 作業,其中 nCount

從 .NET Framework 2.0 開始,這個方法會使用 集合的物件 EqualsCompareTo 方法item來判斷專案是否存在。 在舊版的 .NET Framework 中,已使用 Equals 集合中 物件的 和 CompareTo 方法item,來判斷此判斷。

適用於

另請參閱