[#bsl-basic_string-0faf-2constructor-0de]
= xref:bsl.adoc[bsl]::xref:bsl/basic_string-0faf.adoc[basic&lowbar;string]::basic&lowbar;string
:relfileprefix: ../../
:mrdocs:

Create a string filled with copies of a character&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;&gt;
requires bsl&colon;&colon;IsStdAllocator&lt;ALLOCATOR&gt;&colon;&colon;value
basic&lowbar;string(
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] numChars,
    CHAR&lowbar;TYPE character,
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

== Description

Create a string of the specified `numChars` length whose every position contains the specified `character`&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is not specified, a default&hyphen;constructed allocator is used&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *numChars*
| number of characters
| *character*
| character value used to fill the string
| *basicAllocator*
| allocator used to supply memory
|===


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