System::Array::IndexOf 方法
内容
[
隐藏
]Array::IndexOf(const T&) const method
确定数组中指定项首次出现的索引。
virtual int System::Array<T>::IndexOf(const T &item) const override
| Parameter | Type | 描述 |
|---|---|---|
| item | const T& | 要确定的项索引 |
ReturnValue
如果找到指定项,则返回其第一次出现的索引;否则返回 -1
另见
- Class Array
- Namespace System
- Library Aspose.Page for C++
Array::IndexOf(const ArrayPtr<ArrayType>&, const ValueType&) method
确定数组中指定项首次出现的索引。
template<typename ArrayType,typename ValueType> static int System::Array<T>::IndexOf(const ArrayPtr<ArrayType> &arr, const ValueType &value)
| Parameter | 描述 |
|---|---|
| ArrayType | 目标数组中元素的类型 |
| ValueType | 数组中要搜索的项的类型 |
| Parameter | Type | 描述 |
|---|---|---|
| arr | const ArrayPtr<ArrayType>& | Array 用于在其中搜索指定的项 |
| value | const ValueType& | 要确定的项索引 |
ReturnValue
如果找到指定项,则返回其第一次出现的索引;否则返回 -1
另见
- Typedef ArrayPtr
- Typedef ValueType
- Class Array
- Namespace System
- Library Aspose.Page for C++
Array::IndexOf(const ArrayPtr<ArrayType>&, const ValueType&, int) method
确定从指定索引开始的数组中指定项首次出现的索引。
template<typename ArrayType,typename ValueType> static int System::Array<T>::IndexOf(const ArrayPtr<ArrayType> &arr, const ValueType &value, int startIndex)
| Parameter | 描述 |
|---|---|
| ArrayType | 目标数组中元素的类型 |
| ValueType | 数组中要搜索的项的类型 |
| Parameter | Type | 描述 |
|---|---|---|
| arr | const ArrayPtr<ArrayType>& | Array 用于在其中搜索指定的项 |
| value | const ValueType& | 要确定的项索引 |
| startIndex | int | 搜索开始的索引 |
ReturnValue
如果找到指定项,则返回其第一次出现的索引;否则返回 -1
另见
- Typedef ArrayPtr
- Typedef ValueType
- Class Array
- Namespace System
- Library Aspose.Page for C++
Array::IndexOf(const ArrayPtr<ArrayType>&, const ValueType&, int, int) method
确定由起始索引和范围内元素数量指定的数组范围中指定项首次出现的索引。
template<typename ArrayType,typename ValueType> static int System::Array<T>::IndexOf(const ArrayPtr<ArrayType> &arr, const ValueType &value, int startIndex, int count)
| Parameter | 描述 |
|---|---|
| ArrayType | 目标数组中元素的类型 |
| ValueType | 数组中要搜索的项的类型 |
| Parameter | Type | 描述 |
|---|---|---|
| arr | const ArrayPtr<ArrayType>& | Array 用于在其中搜索指定的项 |
| value | const ValueType& | 要确定的项索引 |
| startIndex | int | 搜索开始的索引 |
| count | int | 要搜索的范围内的元素数量 |
ReturnValue
如果找到指定项,则返回其第一次出现的索引;否则返回 -1
另见
- Typedef ArrayPtr
- Typedef ValueType
- Class Array
- Namespace System
- Library Aspose.Page for C++