System::Array::LastIndexOf 方法

Array::LastIndexOf(const ArrayPtr<ArrayType>&, const ValueType&, int, int) method

确定由起始索引和范围内元素数量指定的数组范围中指定项最后一次出现的索引。

template<typename ArrayType,typename ValueType> static int System::Array<T>::LastIndexOf(const ArrayPtr<ArrayType> &arr, const ValueType &value, int startIndex, int count)
Parameter描述
ArrayType目标数组中元素的类型
ValueType数组中要搜索的项的类型
ParameterType描述
arrconst ArrayPtr<ArrayType>&Array 用于在其中搜索指定的项
valueconst ValueType&要确定的项索引
startIndexint搜索开始的索引
countint要搜索的范围内的元素数量

ReturnValue

如果找到指定项,则返回其最后一次出现的索引;否则返回 -1

另见

Array::LastIndexOf(const ArrayPtr<ArrayType>&, const ValueType&) method

确定数组中指定项最后一次出现的索引。

template<typename ArrayType,typename ValueType> static int System::Array<T>::LastIndexOf(const ArrayPtr<ArrayType> &items, const ValueType &value)
Parameter描述
ArrayType目标数组中元素的类型
ValueType数组中要搜索的项的类型
ParameterType描述
itemsconst ArrayPtr<ArrayType>&Array 用于在其中搜索指定的项
valueconst ValueType&要确定的项索引

ReturnValue

如果找到指定项,则返回其最后一次出现的索引;否则返回 -1

另见

Array::LastIndexOf(const ArrayPtr<ArrayType>&, const ValueType&, int) method

确定从指定索引开始的数组中指定项最后一次出现的索引。

template<typename ArrayType,typename ValueType> static int System::Array<T>::LastIndexOf(const ArrayPtr<ArrayType> &items, const ValueType &value, int startIndex)
Parameter描述
ArrayType目标数组中元素的类型
ValueType数组中要搜索的项的类型
ParameterType描述
itemsconst ArrayPtr<ArrayType>&Array 用于在其中搜索指定的项
valueconst ValueType&要确定的项索引
startIndexint搜索开始的索引

ReturnValue

如果找到指定项,则返回其最后一次出现的索引;否则返回 -1

另见