Olvasás angol nyelven Szerkesztés

Megosztás a következőn keresztül:


JsonProperty.NameEquals Method

Definition

Overloads

NameEquals(ReadOnlySpan<Byte>)

Compares the specified UTF-8 encoded text to the name of this property.

NameEquals(ReadOnlySpan<Char>)

Compares the specified text as a character span to the name of this property.

NameEquals(String)

Compares the specified string to the name of this property.

NameEquals(ReadOnlySpan<Byte>)

Source:
JsonProperty.cs
Source:
JsonProperty.cs
Source:
JsonProperty.cs
Source:
JsonProperty.cs
Source:
JsonProperty.cs
Source:
JsonProperty.cs

Compares the specified UTF-8 encoded text to the name of this property.

C#
public bool NameEquals(ReadOnlySpan<byte> utf8Text);

Parameters

utf8Text
ReadOnlySpan<Byte>

The UTF-8 encoded text to compare against.

Returns

true if the name of this property has the same UTF-8 encoding as utf8Text; otherwise, false.

Exceptions

Remarks

This method is functionally equal to doing an ordinal comparison of utf8Text and Name, but it can avoid creating the string instance.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)

NameEquals(ReadOnlySpan<Char>)

Source:
JsonProperty.cs
Source:
JsonProperty.cs
Source:
JsonProperty.cs
Source:
JsonProperty.cs
Source:
JsonProperty.cs
Source:
JsonProperty.cs

Compares the specified text as a character span to the name of this property.

C#
public bool NameEquals(ReadOnlySpan<char> text);

Parameters

text
ReadOnlySpan<Char>

The text to compare against.

Returns

true if the name of this property matches text; otherwise, false.

Exceptions

Remarks

This method is functionally equal to doing an ordinal comparison of text and Name, but it can avoid creating the string instance.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)

NameEquals(String)

Source:
JsonProperty.cs
Source:
JsonProperty.cs
Source:
JsonProperty.cs
Source:
JsonProperty.cs
Source:
JsonProperty.cs
Source:
JsonProperty.cs

Compares the specified string to the name of this property.

C#
public bool NameEquals(string? text);
C#
public bool NameEquals(string text);

Parameters

text
String

The text to compare against.

Returns

true if the name of this property matches text; otherwise false.

Exceptions

Remarks

This method is functionally equal to doing an ordinal comparison of text and Name.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)