BoundsCheckableList1.IndexOf

BoundsCheckableList<T>.IndexOf 方法

搜索指定对象并返回在整个 System.Collections.Generic.List 中第一次出现的零基索引。

public int IndexOf(T item)
参数类型描述
itemT要在 System.Collections.Generic.List 中定位的对象。对于引用类型,值可以为 null。

返回值

如果找到,返回 item 在整个 System.Collections.Generic.List 中第一次出现的零基索引;否则,返回 –1。

另请参阅