[#BloombergLP-bdljsn-StringUtil-writeString] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::xref:BloombergLP/bdljsn/StringUtil.adoc[StringUtil]::writeString :relfileprefix: ../../../ :mrdocs: Write a JSON‐compliant encoding of `string` to `stream`. == Synopsis Declared in `<bdljsn_stringutil.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static int writeString( std::ostream& stream, std::string_view const& string, int flags = e_NONE); ---- == Description Write to the specified `stream` a JSON‐compliant string that is equivalent to the specified `string`, an arbitrary UTF‐8 codepoint sequence. Return 0 on success and a non‐zero value otherwise. The operation fails if `string` is not a sequence of UTF‐8 codepoints or if there is an error writing to `stream`. See []Arbitrary UTF‐8 to JSON String) for further details. == Return Value 0 on success, and a non‐zero value otherwise == Parameters [cols="1,4"] |=== | Name| Description | *stream* | output stream | *string* | UTF‐8 codepoint sequence to encode | *flags* | optional encoding flags |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#