MemoryExtensions.Contains Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Contains(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) |
Indicates whether a specified value occurs within a read-only character span. |
Contains<T>(ReadOnlySpan<T>, T) |
Indicates whether a specified value is found in a read-only span. Values are compared using IEquatable{T}.Equals(T). |
Contains<T>(Span<T>, T) |
Indicates whether a specified value is found in a span. Values are compared using IEquatable{T}.Equals(T). |
Contains(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison)
Indicates whether a specified value occurs within a read-only character span.
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
Parameters
- span
- ReadOnlySpan<Char>
The source span.
- value
- ReadOnlySpan<Char>
The value to seek within the source span.
- comparisonType
- StringComparison
An enumeration value that determines how the characters in span
and value
are compared.
Returns
true
if value
occurs within the span, false
otherwise.
Applies to
Contains<T>(ReadOnlySpan<T>, T)
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
Indicates whether a specified value is found in a read-only span. Values are compared using 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
Type Parameters
- T
The type of the span.
Parameters
- span
- ReadOnlySpan<T>
The span to search.
- value
- T
The value to search for.
Returns
true
if found, false
otherwise.
Applies to
Contains<T>(Span<T>, T)
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
Indicates whether a specified value is found in a span. Values are compared using 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
Type Parameters
- T
The type of the elements in the span.
Parameters
- span
- Span<T>
The span to search.
- value
- T
The value to search for.
Returns
true
if found, false
otherwise.