MemoryExtensions.SequenceEqual 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.
Determines whether two read-only sequences are equal by comparing the elements using IEquatable{T}.Equals(T).
Overloads
| Name | Description |
|---|---|
|
SequenceEqual |
Determines whether a span and a read-only span are equal by comparing the elements using IEquatable{T}.Equals(T). |
|
SequenceEqual |
Determines whether two read-only sequences are equal by comparing the elements using IEquatable{T}.Equals(T). |
|
SequenceEqual |
Determines whether two sequences are equal by comparing the elements using an IEqualityComparer |
|
SequenceEqual |
Determines whether two sequences are equal by comparing the elements using an IEqualityComparer |
SequenceEqual(Span, ReadOnlySpan)
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
Determines whether a span and a read-only span are equal by comparing the elements using IEquatable{T}.Equals(T).
public:
generic
where T : IEquatable[System::Runtime::CompilerServices::Extension]
static bool SequenceEqual(Span span, ReadOnlySpan other);
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static bool SequenceEqual(this Span span, ReadOnlySpan other) where T : IEquatable;
public static bool SequenceEqual(this Span span, ReadOnlySpan other) where T : IEquatable;
[]
static member SequenceEqual : Span<'T (requires 'T :> IEquatable<'T>)> * ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> -> bool (requires 'T :> IEquatable<'T>)
static member SequenceEqual : Span<'T (requires 'T :> IEquatable<'T>)> * ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> -> bool (requires 'T :> IEquatable<'T>)
Public Function SequenceEqual(Of T As IEquatable(Of T)) (span As Span(Of T), other As ReadOnlySpan(Of T)) As Boolean
Type Parameters
- T
The type of elements in the sequence.
Parameters
- span
-
Span
The span to compare.
- other
-
ReadOnlySpan
The read-only span to compare.
Returns
true if the two sequences are equal; otherwise, false.
- Attributes
Applies to
SequenceEqual(ReadOnlySpan, ReadOnlySpan)
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
Determines whether two read-only sequences are equal by comparing the elements using IEquatable{T}.Equals(T).
public:
generic
where T : IEquatable[System::Runtime::CompilerServices::Extension]
static bool SequenceEqual(ReadOnlySpan span, ReadOnlySpan other);
public static bool SequenceEqual(this ReadOnlySpan span, ReadOnlySpan other) where T : IEquatable;
static member SequenceEqual : ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> * ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> -> bool (requires 'T :> IEquatable<'T>)
Public Function SequenceEqual(Of T As IEquatable(Of T)) (span As ReadOnlySpan(Of T), other As ReadOnlySpan(Of T)) As Boolean
Type Parameters
- T
The type of elements in the sequence.
Parameters
- span
-
ReadOnlySpan
The first sequence to compare.
- other
-
ReadOnlySpan
The second sequence to compare.
Returns
true if the two sequences are equal; otherwise, false.
Applies to
SequenceEqual(ReadOnlySpan, ReadOnlySpan, IEqualityComparer)
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
Determines whether two sequences are equal by comparing the elements using an IEqualityComparer
public static bool SequenceEqual(this ReadOnlySpan span, ReadOnlySpan other, System.Collections.Generic.IEqualityComparer? comparer = default);
static member SequenceEqual : ReadOnlySpan<'T> * ReadOnlySpan<'T> * System.Collections.Generic.IEqualityComparer<'T> -> bool
Public Function SequenceEqual(Of T) (span As ReadOnlySpan(Of T), other As ReadOnlySpan(Of T), Optional comparer As IEqualityComparer(Of T) = Nothing) As Boolean
Type Parameters
- T
The type of elements in the sequence.
Parameters
- span
-
ReadOnlySpan
The first sequence to compare.
- other
-
ReadOnlySpan
The second sequence to compare.
- comparer
-
IEqualityComparer
The IEqualityComparernull to use the default IEqualityComparer
Returns
true if the two sequences are equal; otherwise, false.
Applies to
SequenceEqual(Span, ReadOnlySpan, IEqualityComparer)
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
Determines whether two sequences are equal by comparing the elements using an IEqualityComparer
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static bool SequenceEqual(this Span span, ReadOnlySpan other, System.Collections.Generic.IEqualityComparer? comparer = default);
public static bool SequenceEqual(this Span span, ReadOnlySpan other, System.Collections.Generic.IEqualityComparer? comparer = default);
[]
static member SequenceEqual : Span<'T> * ReadOnlySpan<'T> * System.Collections.Generic.IEqualityComparer<'T> -> bool
static member SequenceEqual : Span<'T> * ReadOnlySpan<'T> * System.Collections.Generic.IEqualityComparer<'T> -> bool
Public Function SequenceEqual(Of T) (span As Span(Of T), other As ReadOnlySpan(Of T), Optional comparer As IEqualityComparer(Of T) = Nothing) As Boolean
Type Parameters
- T
The type of elements in the sequence.
Parameters
- span
-
Span
The first sequence to compare.
- other
-
ReadOnlySpan
The second sequence to compare.
- comparer
-
IEqualityComparer
The IEqualityComparernull to use the default IEqualityComparer
Returns
true if the two sequences are equal; otherwise, false.
- Attributes