Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

JsonEncodedText Struct

Definition

Namespace:
System.Text.Json
Assembly:
System.Text.Json.dll
Package:
System.Text.Json v11.0.0-preview.5.26302.115
Source:
JsonEncodedText.cs
Source:
JsonEncodedText.cs
Source:
JsonEncodedText.cs
Source:
JsonEncodedText.cs
Source:
JsonEncodedText.cs
Source:
JsonEncodedText.cs
Source:
JsonEncodedText.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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

public value class JsonEncodedText : IEquatable<System::Text::Json::JsonEncodedText>
public readonly struct JsonEncodedText : IEquatable<System.Text.Json.JsonEncodedText>
type JsonEncodedText = struct
Public Structure JsonEncodedText
Implements IEquatable(Of 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

Name Description
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

Name Description
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


Feedback

Was this page helpful?