MemoryExtensions.Contains 方法

定义

重载

Contains(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison)

指示指定值是否出现在只读字符跨度内。

Contains<T>(ReadOnlySpan<T>, T)

指示是否在只读跨度内找到指定的值。 使用 IEquatable{T}.Equals(T) 比较各值。

Contains<T>(Span<T>, T)

指示是否在跨度内找到指定的值。 使用 IEquatable{T}.Equals(T) 比较各值。

Contains(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison)

Source:
MemoryExtensions.Globalization.cs
Source:
MemoryExtensions.Globalization.cs
Source:
MemoryExtensions.Globalization.cs

指示指定值是否出现在只读字符跨度内。

public:
[System::Runtime::CompilerServices::Extension]
 static bool Contains(ReadOnlySpan<char> span, ReadOnlySpan<char> value, StringComparison comparisonType);
public static bool Contains (this ReadOnlySpan<char> span, ReadOnlySpan<char> value, StringComparison comparisonType);
static member Contains : ReadOnlySpan<char> * ReadOnlySpan<char> * StringComparison -> bool
<Extension()>
Public Function Contains (span As ReadOnlySpan(Of Char), value As ReadOnlySpan(Of Char), comparisonType As StringComparison) As Boolean

参数

span
ReadOnlySpan<Char>

源跨度。

value
ReadOnlySpan<Char>

要在源跨度中查找的值。

comparisonType
StringComparison

用于确定如何比较 spanvalue 中的字符的枚举值。

返回

如果在跨度内出现 value,则为 true;否则为 false

适用于

Contains<T>(ReadOnlySpan<T>, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

指示是否在只读跨度内找到指定的值。 使用 IEquatable{T}.Equals(T) 比较各值。

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

类型参数

T

范围的类型。

参数

span
ReadOnlySpan<T>

要搜索的跨度。

value
T

要搜索的值。

返回

如果找到,则为 true;否则为 false

适用于

Contains<T>(Span<T>, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

指示是否在跨度内找到指定的值。 使用 IEquatable{T}.Equals(T) 比较各值。

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

类型参数

T

跨度中元素的类型。

参数

span
Span<T>

要搜索的跨度。

value
T

要搜索的值。

返回

如果找到,则为 true;否则为 false

适用于