Objects.CheckIndex Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
CheckIndex(Int32, Int32) |
Checks if the |
CheckIndex(Int64, Int64) |
Checks if the |
CheckIndex(Int32, Int32)
Checks if the index
is within the bounds of the range from
0
(inclusive) to length
(exclusive).
[Android.Runtime.Register("checkIndex", "(II)I", "", ApiSince=30)]
public static int CheckIndex (int index, int length);
[<Android.Runtime.Register("checkIndex", "(II)I", "", ApiSince=30)>]
static member CheckIndex : int * int -> int
Parameters
- index
- Int32
the index
- length
- Int32
the upper-bound (exclusive) of the range
Returns
index
if it is within bounds of the range
- Attributes
Remarks
Checks if the index
is within the bounds of the range from 0
(inclusive) to length
(exclusive).
The index
is defined to be out of bounds if any of the following inequalities is true: <ul> <li>index < 0
</li> <li>index >= length
</li> <li>length < 0
, which is implied from the former inequalities</li> </ul>
Added in 9.
Java documentation for java.util.Objects.checkIndex(int, int)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.
Applies to
CheckIndex(Int64, Int64)
Checks if the index
is within the bounds of the range from
0
(inclusive) to length
(exclusive).
[Android.Runtime.Register("checkIndex", "(JJ)J", "", ApiSince=34)]
public static long CheckIndex (long index, long length);
[<Android.Runtime.Register("checkIndex", "(JJ)J", "", ApiSince=34)>]
static member CheckIndex : int64 * int64 -> int64
Parameters
- index
- Int64
the index
- length
- Int64
the upper-bound (exclusive) of the range
Returns
index
if it is within bounds of the range
- Attributes
Remarks
Checks if the index
is within the bounds of the range from 0
(inclusive) to length
(exclusive).
The index
is defined to be out of bounds if any of the following inequalities is true: <ul> <li>index < 0
</li> <li>index >= length
</li> <li>length < 0
, which is implied from the former inequalities</li> </ul>
Added in 16.
Java documentation for java.util.Objects.checkIndex(long, long)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.