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

定义

返回 itemReadOnlySequence<T> 中第一次出现的位置。

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 的对象。

适用于