Skip to content

JsonElement.ToString Method

Definition

Namespace: Corvus.Text.Json
Assembly: Corvus.Text.Json.dll

Overloads

Method Description
ToString() Gets a string representation for the current value appropriate to the value type.
ToString(string, IFormatProvider)

ToString()

Source: JsonElement.cs

Gets a string representation for the current value appropriate to the value type.

public override string ToString()

Returns

string

A string representation for the current value appropriate to the value type.

Exceptions

Exception Description
ObjectDisposedException The parent JsonDocument has been disposed.

Remarks

For JsonElement built from JsonDocument: For Null, Empty is returned. For True, TrueString is returned. For False, FalseString is returned. For String, the value of GetString() is returned. For other types, the value of GetRawText() is returned.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

ToString(string, IFormatProvider)

Source: JsonElement.cs

public string ToString(string format, IFormatProvider formatProvider)

Parameters

Name Type Description
format string
formatProvider IFormatProvider

Returns

string

Implements

IFormattable.ToString

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests.

Open an issue