共用方式為


BuffersExtensions.PositionOf<T>(ReadOnlySequence<T>, T) 方法

定義

傳回 ReadOnlySequence<T> 中出現第一個 item 的位置。

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static Nullable<SequencePosition> PositionOf(System::Buffers::ReadOnlySequence<T> % source, T value);
public static SequencePosition? PositionOf<T> (this in System.Buffers.ReadOnlySequence<T> source, T value) where T : IEquatable<T>;
static member PositionOf : ReadOnlySequence * 'T -> Nullable<SequencePosition> (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function PositionOf(Of T As IEquatable(Of T)) (ByRef source As ReadOnlySequence(Of T), value As T) As Nullable(Of SequencePosition)

類型參數

T

ReadOnlySequence<T>專案的型別。

參數

value
T

用來在 ReadOnlySequence<T> 中尋找的項目。

傳回

GetInteger() 方法會傳回 item 第一個出現位置的物件,或其 Nullable<SequencePosition>.HasValue 屬性為 false 的物件。

適用於