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

Create a string from a null&hyphen;terminated character string&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(
    CHAR&lowbar;TYPE const* characterString,
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

== Description

Create a string having the same value as the specified null&hyphen;terminated `characterString` (of length `CHAR&lowbar;TRAITS&colon;&colon;length(characterString)`)&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
| *characterString*
| null&hyphen;terminated string used to initialize this string
| *basicAllocator*
| allocator used to supply memory
|===


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