Utf8JsonReader.ValueTextEquals 方法

定义

重载

ValueTextEquals(ReadOnlySpan<Byte>)

比较只读字节范围中 UTF-8 编码文本与源中未转义的 JSON 令牌值,返回指示其是否匹配的值。Compares the UTF-8 encoded text in a read-only byte span to the unescaped JSON token value in the source and returns a value that indicates whether they match.

ValueTextEquals(ReadOnlySpan<Char>)

比较只读字符范围中文本与源中未转义的 JSON 令牌值,返回指示其是否匹配的值。Compares the text in a read-only character span to the unescaped JSON token value in the source and returns a value that indicates whether they match.

ValueTextEquals(String)

比较字符串文本与源中未转义的 JSON 令牌值,返回指示其是否匹配的值。Compares the string text to the unescaped JSON token value in the source and returns a value that indicates whether they match.

ValueTextEquals(ReadOnlySpan<Byte>)

比较只读字节范围中 UTF-8 编码文本与源中未转义的 JSON 令牌值,返回指示其是否匹配的值。Compares the UTF-8 encoded text in a read-only byte span to the unescaped JSON token value in the source and returns a value that indicates whether they match.

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

参数

utf8Text
ReadOnlySpan<Byte>

要进行比较的 UTF-8 编码文本。The UTF-8 encoded text to compare against.

返回

Boolean

如果源中的 JSON 令牌值与 UTF-8 编码查找文本匹配,则 true;否则 falsetrue if the JSON token value in the source matches the UTF-8 encoded lookup text; otherwise, false.

例外

JSON 令牌不是 JSON 字符串(即不是 StringPropertyName)。The JSON token is not a JSON string (that is, it is not String or PropertyName).

注解

查找文本必须为有效的 UTF-8 文本。The lookup text must be valid UTF-8 text. 否则, true 如果源具有包含与匹配的无效 utf-8 文本的字符串标记,则此方法可能返回。Otherwise, this method could return true if the source has a string token containing invalid UTF-8 text that matches.

在源中的 JSON 标记值和查找文本的比较是在需要时通过首先取消转义源中的 JSON 值来完成的。The comparison of the JSON token value in the source and the lookup text is done by first unescaping the JSON value in source, if required. 查找文本将按原样匹配,而不会对其进行任何修改。The lookup text is matched as is, without any modifications to it.

适用于

ValueTextEquals(ReadOnlySpan<Char>)

比较只读字符范围中文本与源中未转义的 JSON 令牌值,返回指示其是否匹配的值。Compares the text in a read-only character span to the unescaped JSON token value in the source and returns a value that indicates whether they match.

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

参数

text
ReadOnlySpan<Char>

要针对其进行比较的文本。The text to compare against.

返回

Boolean

如果源中的 JSON 令牌值与查找文本匹配,则 true;否则 falsetrue if the JSON token value in the source matches the lookup text; otherwise, false.

例外

JSON 令牌不是 JSON 字符串(即不是 StringPropertyName)。The JSON token is not a JSON string (that is, it is not String or PropertyName).

注解

如果查找文本无效或不完整的 UTF-16 文本 (也就是说,不成对的代理项) ,则方法返回, false 因为 JSON 有效负载中不能有无效的 utf-16。If the lookup text is invalid or incomplete UTF-16 text (that is, unpaired surrogates), the method returns false since you can't have invalid UTF-16 within the JSON payload.

在源中的 JSON 标记值和查找文本的比较是在需要时通过首先取消转义源中的 JSON 值来完成的。The comparison of the JSON token value in the source and the lookup text is done by first unescaping the JSON value in source, if required. 查找文本将按原样匹配,而不会对其进行任何修改。The lookup text is matched as is, without any modifications to it.

适用于

ValueTextEquals(String)

比较字符串文本与源中未转义的 JSON 令牌值,返回指示其是否匹配的值。Compares the string text to the unescaped JSON token value in the source and returns a value that indicates whether they match.

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

参数

text
String

要针对其进行比较的文本。The text to compare against.

返回

Boolean

如果源中的 JSON 令牌值与查找文本匹配,则 true;否则 falsetrue if the JSON token value in the source matches the lookup text; otherwise, false.

例外

JSON 令牌不是 JSON 字符串(即不是 StringPropertyName)。The JSON token is not a JSON string (that is, it is not String or PropertyName).

注解

如果查找文本无效或不完整的 UTF-16 文本 (也就是说,不成对的代理项) ,则方法返回, false 因为 JSON 有效负载中不能有无效的 utf-16。If the lookup text is invalid or incomplete UTF-16 text (that is, unpaired surrogates), the method returns false since you can't have invalid UTF-16 within the JSON payload.

在源中的 JSON 标记值和查找文本的比较是在需要时通过首先取消转义源中的 JSON 值来完成的。The comparison of the JSON token value in the source and the lookup text is done by first unescaping the JSON value in source, if required. 查找文本将按原样匹配,而不会对其进行任何修改。The lookup text is matched as is, without any modifications to it.

适用于