Skip to content

IJsonDocument.TryGetString Method

Definition

Namespace: Corvus.Text.Json.Internal
Assembly: Corvus.Text.Json.dll
Source: IJsonDocument.cs

TryGetString(int, JsonTokenType, ref string)

Tries to get the string value of the element at the specified index.

public abstract bool TryGetString(int index, JsonTokenType expectedType, ref string result)

Parameters

Name Type Description
index int The index of the element.
expectedType JsonTokenType The expected JSON token type.
result ref string The string value, or null if the value was not retrieved.

Returns

bool

true if the value was retrieved; otherwise, false.

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