Redigera

Dela via


JsonElement.Parse Method

Definition

Overloads

Parse(String, JsonDocumentOptions)

Parses text representing a single JSON value into a JsonElement.

Parse(ReadOnlySpan<Byte>, JsonDocumentOptions)

Parses UTF8-encoded text representing a single JSON value into a JsonElement.

Parse(ReadOnlySpan<Char>, JsonDocumentOptions)

Parses text representing a single JSON value into a JsonElement.

Parse(String, JsonDocumentOptions)

Source:
JsonElement.Parse.cs

Parses text representing a single JSON value into a JsonElement.

public static System.Text.Json.JsonElement Parse(string json, System.Text.Json.JsonDocumentOptions options = default);
static member Parse : string * System.Text.Json.JsonDocumentOptions -> System.Text.Json.JsonElement
Public Shared Function Parse (json As String, Optional options As JsonDocumentOptions = Nothing) As JsonElement

Parameters

json
String

The JSON text to parse.

options
JsonDocumentOptions

Options to control the reader behavior during parsing.

Returns

A JsonElement representation of the JSON value.

Exceptions

json is null.

json does not represent a valid single JSON value.

options contains unsupported options.

Applies to

Parse(ReadOnlySpan<Byte>, JsonDocumentOptions)

Source:
JsonElement.Parse.cs

Parses UTF8-encoded text representing a single JSON value into a JsonElement.

public static System.Text.Json.JsonElement Parse(ReadOnlySpan<byte> utf8Json, System.Text.Json.JsonDocumentOptions options = default);
static member Parse : ReadOnlySpan<byte> * System.Text.Json.JsonDocumentOptions -> System.Text.Json.JsonElement
Public Shared Function Parse (utf8Json As ReadOnlySpan(Of Byte), Optional options As JsonDocumentOptions = Nothing) As JsonElement

Parameters

utf8Json
ReadOnlySpan<Byte>

The JSON text to parse.

options
JsonDocumentOptions

Options to control the reader behavior during parsing.

Returns

A JsonElement representation of the JSON value.

Exceptions

utf8Json does not represent a valid single JSON value.

options contains unsupported options.

Applies to

Parse(ReadOnlySpan<Char>, JsonDocumentOptions)

Source:
JsonElement.Parse.cs

Parses text representing a single JSON value into a JsonElement.

public static System.Text.Json.JsonElement Parse(ReadOnlySpan<char> json, System.Text.Json.JsonDocumentOptions options = default);
static member Parse : ReadOnlySpan<char> * System.Text.Json.JsonDocumentOptions -> System.Text.Json.JsonElement
Public Shared Function Parse (json As ReadOnlySpan(Of Char), Optional options As JsonDocumentOptions = Nothing) As JsonElement

Parameters

json
ReadOnlySpan<Char>

The JSON text to parse.

options
JsonDocumentOptions

Options to control the reader behavior during parsing.

Returns

A JsonElement representation of the JSON value.

Exceptions

json does not represent a valid single JSON value.

options contains unsupported options.

Applies to