Op Englesch liesen Editéieren

Deelen iwwer


JsonEncodedText Struct

Definition

Provides methods to transform UTF-8 or UTF-16 encoded text into a form that is suitable for JSON.

C#
public readonly struct JsonEncodedText : IEquatable<System.Text.Json.JsonEncodedText>
Inheritance
JsonEncodedText
Implements

Remarks

This type can be used to cache and store known strings used for writing JSON ahead of time by pre-encoding them up front.

Properties

EncodedUtf8Bytes

Gets the UTF-8 encoded representation of the pre-encoded JSON text.

Value

Gets the UTF-16 encoded representation of the pre-encoded JSON text as a String.

Methods

Encode(ReadOnlySpan<Byte>, JavaScriptEncoder)

Encodes a UTF-8 text value as a JSON string.

Encode(ReadOnlySpan<Char>, JavaScriptEncoder)

Encodes a specified text value as a JSON string.

Encode(String, JavaScriptEncoder)

Encodes the string text value as a JSON string.

Equals(JsonEncodedText)

Determines whether this instance and another specified JsonEncodedText instance have the same value.

Equals(Object)

Determines whether this instance and a specified object, which must also be a JsonEncodedText instance, have the same value.

GetHashCode()

Returns the hash code for this JsonEncodedText.

ToString()

Converts the value of this instance to a String.

Applies to

Produkt Versiounen
.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)