แก้ไข

แชร์ผ่าน


JsonElement.ValueEquals Method

Definition

Overloads

ValueEquals(ReadOnlySpan<Byte>)

Compares the text represented by a UTF8-encoded byte span to the string value of this element.

ValueEquals(ReadOnlySpan<Char>)

Compares a specified read-only character span to the string value of this element.

ValueEquals(String)

Compares a specified string to the string value of this element.

ValueEquals(ReadOnlySpan<Byte>)

Source:
JsonElement.cs
Source:
JsonElement.cs
Source:
JsonElement.cs
Source:
JsonElement.cs
Source:
JsonElement.cs

Compares the text represented by a UTF8-encoded byte span to the string value of this element.

public:
 bool ValueEquals(ReadOnlySpan<System::Byte> utf8Text);
public bool ValueEquals (ReadOnlySpan<byte> utf8Text);
member this.ValueEquals : ReadOnlySpan<byte> -> bool
Public Function ValueEquals (utf8Text As ReadOnlySpan(Of Byte)) As Boolean

Parameters

utf8Text
ReadOnlySpan<Byte>

The UTF-8 encoded text to compare against.

Returns

true if the string value of this element has the same UTF-8 encoding as utf8Text; otherwise, false.

Exceptions

Remarks

This method is functionally equal to doing an ordinal comparison of the string produced by UTF-8 decoding utf8Text with the result of calling GetString(), but avoids creating the string instances.

Applies to

ValueEquals(ReadOnlySpan<Char>)

Source:
JsonElement.cs
Source:
JsonElement.cs
Source:
JsonElement.cs
Source:
JsonElement.cs
Source:
JsonElement.cs

Compares a specified read-only character span to the string value of this element.

public:
 bool ValueEquals(ReadOnlySpan<char> text);
public bool ValueEquals (ReadOnlySpan<char> text);
member this.ValueEquals : ReadOnlySpan<char> -> bool
Public Function ValueEquals (text As ReadOnlySpan(Of Char)) As Boolean

Parameters

text
ReadOnlySpan<Char>

The text to compare against.

Returns

true if the string value of this element matches text; otherwise, false.

Exceptions

Remarks

This method is functionally equal to doing an ordinal comparison of text and the result of calling GetString(), but avoids creating the string instance.

Applies to

ValueEquals(String)

Source:
JsonElement.cs
Source:
JsonElement.cs
Source:
JsonElement.cs
Source:
JsonElement.cs
Source:
JsonElement.cs

Compares a specified string to the string value of this element.

public:
 bool ValueEquals(System::String ^ text);
public bool ValueEquals (string? text);
public bool ValueEquals (string text);
member this.ValueEquals : string -> bool
Public Function ValueEquals (text As String) As Boolean

Parameters

text
String

The text to compare against.

Returns

true if the string value of this element matches text; otherwise, false.

Exceptions

Remarks

This method is functionally equal to doing an ordinal comparison of text and the result of calling GetString(), but avoids creating the string instance.

Applies to