IJsonDocument.TryGetLine Method
Definition
Namespace: Corvus.Text.Json.Internal
Assembly: Corvus.Text.Json.dll
Overloads
| Method | Description |
|---|---|
| TryGetLine(int, ReadOnlyMemory<byte>) | Tries to get the specified line from the original source document as UTF-8 bytes. |
| TryGetLine(int, string?) | Tries to get the specified line from the original source document as a string. |
TryGetLine(int, 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, out ReadOnlyMemory<byte> line)
Parameters
| Name | Type | Description |
|---|---|---|
lineNumber |
int |
The 1-based line number to retrieve. |
line |
ReadOnlyMemory<byte> |
When this method returns, contains the UTF-8 bytes of the line if successful. |
Returns
true if the line was successfully retrieved; otherwise, false.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
TryGetLine(int, string?)
Source: IJsonDocument.cs
Tries to get the specified line from the original source document as a string.
public abstract bool TryGetLine(int lineNumber, out string? line)
Parameters
| Name | Type | Description |
|---|---|---|
lineNumber |
int |
The 1-based line number to retrieve. |
line |
string? |
When this method returns, contains the line text if successful. |
Returns
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