Utf8JsonWriter.WriteCommentValue Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
WriteCommentValue(ReadOnlySpan<Byte>) |
Writes a UTF-8 text value as a JSON comment. |
WriteCommentValue(ReadOnlySpan<Char>) |
Writes a UTF-16 text value as a JSON comment. |
WriteCommentValue(String) |
Writes a string text value as a JSON comment. |
Writes a UTF-8 text value as a JSON comment.
public:
void WriteCommentValue(ReadOnlySpan<System::Byte> utf8Value);
public void WriteCommentValue (ReadOnlySpan<byte> utf8Value);
member this.WriteCommentValue : ReadOnlySpan<byte> -> unit
Public Sub WriteCommentValue (utf8Value As ReadOnlySpan(Of Byte))
Parameters
- utf8Value
- ReadOnlySpan<Byte>
The UTF-8 encoded value to be written as a JSON comment within /../
.
Exceptions
The specified value is too large.
-or-
utf8Value
contains a comment delimiter (that is, */
).
Remarks
The comment value is not escaped before writing.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9 |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided) |
Writes a UTF-16 text value as a JSON comment.
public:
void WriteCommentValue(ReadOnlySpan<char> value);
public void WriteCommentValue (ReadOnlySpan<char> value);
member this.WriteCommentValue : ReadOnlySpan<char> -> unit
Public Sub WriteCommentValue (value As ReadOnlySpan(Of Char))
Parameters
- value
- ReadOnlySpan<Char>
The UTF-16 encoded value to be written as a UTF-8 transcoded JSON comment within /../
.
Exceptions
The specified value is too large.
-or-
value
contains a comment delimiter (that is, */
).
Remarks
The comment value is not escaped before writing.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9 |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided) |
Writes a string text value as a JSON comment.
public:
void WriteCommentValue(System::String ^ value);
public void WriteCommentValue (string value);
member this.WriteCommentValue : string -> unit
Public Sub WriteCommentValue (value As String)
Parameters
- value
- String
The UTF-16 encoded value to be written as a UTF-8 transcoded JSON comment within /../
.
Exceptions
The specified value is too large.
-or-
value
contains a comment delimiter (that is, */
).
The value
parameter is null
.
Remarks
The comment value is not escaped before writing.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9 |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: