GetOffsetAndLength()

Range::GetOffsetAndLength(int32_t) const method

Computes the zero-based start offset and length for the specified collection length.

System::ValueTuple<int32_t, int32_t> System::Range::GetOffsetAndLength(int32_t length) const

Arguments

ParameterTypeDescription
lengthint32_tThe length of the collection.

Return Value

The tuple containing zero-based index from the start of the collection and the number of elements selected by the range.

Exceptions

ExceptionDescription
ArgumentOutOfRangeExceptionif the length is invalid or the start index is out of range.

See Also