Upraviť

Zdieľať cez


NRange.GetOffsetAndLength(IntPtr) Method

Definition

Calculate the start offset and length of NRange object using a collection length.

public:
 ValueTuple<IntPtr, IntPtr> GetOffsetAndLength(IntPtr length);
public (IntPtr Offset, IntPtr Length) GetOffsetAndLength (IntPtr length);
member this.GetOffsetAndLength : nativeint -> ValueTuple<nativeint, nativeint>
Public Function GetOffsetAndLength (length As IntPtr) As ValueTuple(Of IntPtr, IntPtr)

Parameters

length
IntPtr

nativeint

The length of the collection that the NRange will be used with. length has to be a positive value.

Returns

ValueTuple<IntPtr,IntPtr>

ValueTuple<nativeint,nativeint>

Remarks

For performance reason, we don't validate the input length parameter against negative values.

It is expected NRange will be used with collections which always have non negative length/count.

We validate the NRange is inside the length scope though.

Applies to