MatchCollection.IList.IndexOf(Object) 方法

定義

決定集合中指定項目的索引。

 virtual int System.Collections.IList.IndexOf(System::Object ^ value) = System::Collections::IList::IndexOf;
int IList.IndexOf (object value);
abstract member System.Collections.IList.IndexOf : obj -> int
override this.System.Collections.IList.IndexOf : obj -> int
Function IndexOf (value As Object) As Integer Implements IList.IndexOf

參數

value
Object

要在集合中找出的物件。

傳回

Int32

如果可在清單中找到則為 value 的索引,否則為 -1。

實作

備註

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

適用於