BuffersExtensions.PositionOf<T>(ReadOnlySequence<T>, T) 方法
定义
返回 item 在 ReadOnlySequence<T> 中第一次出现的位置。Returns the position of the first occurrence of item in the ReadOnlySequence<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 ref 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> 。The type of the items in the ReadOnlySequence<T>.
参数
- source
- ReadOnlySequence<T>
源 ReadOnlySequence<T>。The source ReadOnlySequence<T>.
- value
- T
要在 ReadOnlySequence<T> 中查找的项。The item to find in the ReadOnlySequence<T>.
返回
一个对象,其 GetInteger() 方法返回第一次出现 item 的位置;或者为一个其 Nullable<SequencePosition>.HasValue 属性是 false 的对象。An object whose GetInteger() method returns the position of the first occurrence of item, or an object whose Nullable<SequencePosition>.HasValue property is false .