MemoryExtensions.Count 方法

定义

重载

Count<T>(Span<T>, ReadOnlySpan<T>)

计算指定 valuespan中发生的次数。

Count<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

计算 span中发生的 value 次数。

Count<T>(ReadOnlySpan<T>, T)

计算指定 valuespan中发生的次数。

Count<T>(Span<T>, T)

计算指定 valuespan中发生的次数。

Count<T>(Span<T>, ReadOnlySpan<T>)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

计算指定 valuespan中发生的次数。

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static int Count(Span<T> span, ReadOnlySpan<T> value);
public static int Count<T> (this Span<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>;
static member Count : Span<'T (requires 'T :> IEquatable<'T>)> * ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> -> int (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function Count(Of T As IEquatable(Of T)) (span As Span(Of T), value As ReadOnlySpan(Of T)) As Integer

类型参数

T

范围的元素类型。

参数

span
Span<T>

要搜索的跨度。

value
ReadOnlySpan<T>

要搜索的值。

返回

span中发现了 value 的次数。

适用于

Count<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

计算 span中发生的 value 次数。

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static int Count(ReadOnlySpan<T> span, ReadOnlySpan<T> value);
public static int Count<T> (this ReadOnlySpan<T> span, ReadOnlySpan<T> value) where T : IEquatable<T>;
static member Count : ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> * ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> -> int (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function Count(Of T As IEquatable(Of T)) (span As ReadOnlySpan(Of T), value As ReadOnlySpan(Of T)) As Integer

类型参数

T

范围的元素类型。

参数

span
ReadOnlySpan<T>

要搜索的跨度。

value
ReadOnlySpan<T>

要搜索的值。

返回

span中发现了 value 的次数。

适用于

Count<T>(ReadOnlySpan<T>, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

计算指定 valuespan中发生的次数。

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static int Count(ReadOnlySpan<T> span, T value);
public static int Count<T> (this ReadOnlySpan<T> span, T value) where T : IEquatable<T>;
static member Count : ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> * 'T -> int (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function Count(Of T As IEquatable(Of T)) (span As ReadOnlySpan(Of T), value As T) As Integer

类型参数

T

范围的元素类型。

参数

span
ReadOnlySpan<T>

要搜索的跨度。

value
T

要搜索的值。

返回

span中发现了 value 的次数。

适用于

Count<T>(Span<T>, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

计算指定 valuespan中发生的次数。

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static int Count(Span<T> span, T value);
public static int Count<T> (this Span<T> span, T value) where T : IEquatable<T>;
static member Count : Span<'T (requires 'T :> IEquatable<'T>)> * 'T -> int (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function Count(Of T As IEquatable(Of T)) (span As Span(Of T), value As T) As Integer

类型参数

T

范围的元素类型。

参数

span
Span<T>

要搜索的跨度。

value
T

要搜索的值。

返回

span中发现了 value 的次数。

适用于