LastIndexOf
LastIndexOf
搜索列表中最后出现的值。
整个版本搜索整个列表。
int LastIndexOf(
T item // 搜索值
);从指定位置搜索到列表结束的版本。
int LastIndexOf(
T item, // 搜索值
const int start_index //索引起始点
);从指定范围指定位置搜索的版本。
int LastIndexOf(
T item, // 搜索值
const int start_index, //索引起始点
const int count //搜索范围
);参数
- item
[in] 已搜索的值。
- start_index
[in] 搜索开始的索引起始点。
- count
[in] 搜索范围长度。
返回值
返回最后找到的元素的索引。如果该值未找到,返回-1。