Utf8JsonWriter.WriteCommentValue Method
Definition
Namespace: Corvus.Text.Json
Assembly: Corvus.Text.Json.dll
Overloads
| Method | Description |
|---|---|
| WriteCommentValue(string) | Writes the string text value (as a JSON comment). |
| WriteCommentValue(ReadOnlySpan<char>) | Writes the text value (as a JSON comment). |
| WriteCommentValue(ReadOnlySpan<byte>) | Writes the UTF-8 text value (as a JSON comment). |
WriteCommentValue(string)
Source: Utf8JsonWriter.WriteValues.Comment.cs
Writes the string text value (as a JSON comment).
public void WriteCommentValue(string value)
Parameters
| Name | Type | Description |
|---|---|---|
value |
string |
The value to write as a JSON comment within /../. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified value is too large OR if the given string text value contains a comment delimiter (that is, */). |
ArgumentNullException |
The value parameter is null. |
Remarks
The comment value is not escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteCommentValue(ReadOnlySpan<char>)
Source: Utf8JsonWriter.WriteValues.Comment.cs
Writes the text value (as a JSON comment).
public void WriteCommentValue(ReadOnlySpan<char> value)
Parameters
| Name | Type | Description |
|---|---|---|
value |
ReadOnlySpan<char> |
The value to write as a JSON comment within /../. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified value is too large OR if the given text value contains a comment delimiter (that is, */). |
Remarks
The comment value is not escaped before writing.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
WriteCommentValue(ReadOnlySpan<byte>)
Source: Utf8JsonWriter.WriteValues.Comment.cs
Writes the UTF-8 text value (as a JSON comment).
public void WriteCommentValue(ReadOnlySpan<byte> utf8Value)
Parameters
| Name | Type | Description |
|---|---|---|
utf8Value |
ReadOnlySpan<byte> |
The UTF-8 encoded value to be written as a JSON comment within /../. |
Exceptions
| Exception | Description |
|---|---|
ArgumentException |
Thrown when the specified value is too large OR if the given UTF-8 text value contains a comment delimiter (that is, */). |
Remarks
The comment value is not escaped before writing.
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