Skip to content

IJsonDocument.TryGetLine Method

Definition

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

Overloads

Method Description
TryGetLine(int, ref ReadOnlyMemory<byte>) Tries to get the specified line from the original source document as UTF-8 bytes.
TryGetLine(int, ref string) Tries to get the specified line from the original source document as a string.

TryGetLine(int, ref ReadOnlyMemory<byte>)

Source: IJsonDocument.cs

Tries to get the specified line from the original source document as UTF-8 bytes.

public abstract bool TryGetLine(int lineNumber, ref ReadOnlyMemory<byte> line)

Parameters

Name Type Description
lineNumber int The 1-based line number to retrieve.
line ref ReadOnlyMemory<byte> When this method returns, contains the UTF-8 bytes of the line if successful.

Returns

bool

true if the line was successfully retrieved; otherwise, false.

Applies To

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

TryGetLine(int, ref string)

Source: IJsonDocument.cs

Tries to get the specified line from the original source document as a string.

public abstract bool TryGetLine(int lineNumber, ref string line)

Parameters

Name Type Description
lineNumber int The 1-based line number to retrieve.
line ref string When this method returns, contains the line text if successful.

Returns

bool

true if the line was successfully 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