Edit

Share via


ReadOnlySequence<T>.GetOffset(SequencePosition) Method

Definition

Returns the offset of a position within this sequence.

public:
 long GetOffset(SequencePosition position);
public long GetOffset(SequencePosition position);
member this.GetOffset : SequencePosition -> int64
Public Function GetOffset (position As SequencePosition) As Long

Parameters

position
SequencePosition

The SequencePosition of which to get the offset.

Returns

The offset in the sequence.

Exceptions

The position is out of range.

Remarks

The returned offset is not a zero-based index from the start. To obtain the zero-based index offset, subtract mySequence.GetOffset(mySequence.Start) from the returned offset.

Applies to