System::Collections::Generic::List::LastIndexOf 方法

List::LastIndexOf(const T&) const method

搜索指定对象并返回其在整个列表中最后一次出现的零基索引。

int32_t System::Collections::Generic::List<T>::LastIndexOf(const T &item) const
ParameterType描述
itemconst T&要在列表中定位的对象

ReturnValue

如果找到,则返回整个 List 中项最后一次出现的零基索引;否则为 -1。

另见

List::LastIndexOf(const T&, int32_t) const method

搜索指定对象并返回从第一个元素到指定索引范围内的元素中,该对象最后一次出现的零基索引。

int32_t System::Collections::Generic::List<T>::LastIndexOf(const T &item, int32_t index) const
ParameterType描述
itemconst T&要在列表中定位的对象
索引int32_t向后搜索的零基起始索引。

ReturnValue

如果找到,则返回从第一个元素到 index 范围内的 List 中项最后一次出现的零基索引;否则为 -1。

另见

List::LastIndexOf(const T&, int32_t, int32_t) const method

搜索指定对象并返回在包含指定数量元素且以指定索引结束的 List 范围内,该对象最后一次出现的零基索引。

int32_t System::Collections::Generic::List<T>::LastIndexOf(const T &item, int32_t index, int32_t count) const
ParameterType描述
itemconst T&要在 List 中定位的对象
索引int32_t向后搜索的零基起始索引。
countint32_t要搜索的区段中的元素数量。

ReturnValue

如果找到,则返回在包含 count 个元素且以 index 结束的 List 范围内项最后一次出现的零基索引;否则为 -1。

另见