IListContract<T>.IndexOf(T) 方法

定义

返回集合中 IListContract<C> 特定项的索引。

public:
 int IndexOf(T item);
public int IndexOf(T item);
abstract member IndexOf : 'T -> int
Public Function IndexOf (item As T) As Integer

参数

item
T

集合中的项。

返回

指定项的索引。

注解

如果集合中有多个同一类型的对象,则此方法标识集合中指定类型第一次出现的项的索引。

该方法 GetItem 不会删除指定索引处的项。 若要从 IListContract<T> 集合中删除项,请使用 RemoveAt 该方法。

适用于