ReadOnlySpan<T>.Equality(ReadOnlySpan<T>, ReadOnlySpan<T>) ReadOnlySpan<T>.Equality(ReadOnlySpan<T>, ReadOnlySpan<T>) ReadOnlySpan<T>.Equality(ReadOnlySpan<T>, ReadOnlySpan<T>) ReadOnlySpan<T>.Equality(ReadOnlySpan<T>, ReadOnlySpan<T>) Operator

定义

返回一个值,该值指示两个 ReadOnlySpan<T> 实例是否相等。Returns a value that indicates whether two ReadOnlySpan<T> instances are equal.

public:
 static bool operator ==(ReadOnlySpan<T> left, ReadOnlySpan<T> right);
public static bool operator == (ReadOnlySpan<T> left, ReadOnlySpan<T> right);
static member ( = ) : ReadOnlySpan<'T> * ReadOnlySpan<'T> -> bool
Public Shared Operator == (left As ReadOnlySpan(Of T), right As ReadOnlySpan(Of T)) As Boolean

参数

left
ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T>

要比较的第一个范围。The first span to compare.

right
ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T>

要比较的第二个范围。The second span to compare.

返回

如果这两个 ReadOnlySpan<T> 实例相等,则为 true;否则为 falsetrue if the two ReadOnlySpan<T> instances are equal; otherwise, false

注解

这将测试两ReadOnlySpan<T>个实例是否指向相同的起始内存位置, 并具有相同Length的值。This tests if two ReadOnlySpan<T> instances point to the same starting memory location, and have the same Length values. 这不会比较两个ReadOnlySpan<T>实例的内容。This does not compare the contents of two ReadOnlySpan<T> instances.

适用于