ReadOnlyMemory<T>.Equals Method

Definition

Overloads

Equals(Object)

Determines whether the specified object is equal to the current read-only memory region.

Equals(ReadOnlyMemory<T>)

Determines whether the current instance and a specified ReadOnlyMemory<T> objects are equal.

Equals(Object)

Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs

Determines whether the specified object is equal to the current read-only memory region.

C#
public override bool Equals(object? obj);
C#
public override bool Equals(object obj);

Parameters

obj
Object

The object to compare.

Returns

true if the current instance and obj are equal; otherwise, false.

Applies to

.NET 10 dan versi lain
Produk Versi
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1

Equals(ReadOnlyMemory<T>)

Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs
Source:
ReadOnlyMemory.cs

Determines whether the current instance and a specified ReadOnlyMemory<T> objects are equal.

C#
public bool Equals(ReadOnlyMemory<T> other);

Parameters

other
ReadOnlyMemory<T>

The read-only memory to compare.

Returns

true if the current instance and other are equal; otherwise, false.

Implements

Remarks

[!IMPORTANT]

Two ReadOnlyMemory<T> objects are equal if the memory regions point to the same array and have the same length. The method does not check to see if the contents are equal.

Applies to

.NET 10 dan versi lain
Produk Versi
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1