[#bsl-bitset-to_string]
= xref:bsl.adoc[bsl]::xref:bsl/bitset.adoc[bitset]::to&lowbar;string
:relfileprefix: ../../
:mrdocs:

Return a string representation of this bitset using `zero` and `one`&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;bitset&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class CHAR&lowbar;TYPE = char,
    class TRAITS = char&lowbar;traits&lt;CHAR&lowbar;TYPE&gt;,
    class ALLOCATOR = xref:bsl/allocator-0df.adoc[allocator&lt;CHAR&lowbar;TYPE&gt;]&gt;
xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;CHAR&lowbar;TYPE, TRAITS, ALLOCATOR&gt;]
to&lowbar;string(
    CHAR&lowbar;TYPE zero = CHAR&lowbar;TYPE(&apos;0&apos;),
    CHAR&lowbar;TYPE one = CHAR&lowbar;TYPE(&apos;1&apos;)) const;
----

== Description

Return a `basic&lowbar;string` representation of this bitset, where the zero&hyphen;bits are represented by the specified `zero` character and the one&hyphen;bits are represented by the specified `one` character&period; The most&hyphen;significant bit is placed at the beginning of the string, and the least&hyphen;significant bit is placed at the end of the string&period;

== Return Value

string representation of this bitset

== Parameters

[cols="1,4"]
|===
| Name| Description
| *zero*
| character representing an unset bit (default &apos;0&apos;)
| *one*
| character representing a set bit (default &apos;1&apos;)
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
