System::Collections::Generic::List::IndexOf 方法

List::IndexOf(const T&) const method

获取特定项的第一个索引。

int System::Collections::Generic::List<T>::IndexOf(const T &item) const override
参数类型描述
const T&要查找的项。

ReturnValue

指定项首次出现的索引,如果未找到则为 -1。

另见

List::IndexOf(const T&, int) const method

在列表中查找特定项。

int System::Collections::Generic::List<T>::IndexOf(const T &item, int index) const
参数类型描述
const T&要查找的项。
索引int开始查找的索引。

ReturnValue

指定项首次实例的索引,如果未找到则为 -1。

另见