[#bsl-basic_string-0f3-2constructor-0e3]
= xref:bsl.adoc[bsl]::xref:bsl/basic_string-0f3.adoc[basic&lowbar;string&lt;char32&lowbar;t&gt;]::basic&lowbar;string
:relfileprefix: ../../
:mrdocs:

Create a string that has the same value as the substring starting at the specified `position` in the specified `original` string&period; Optionally specify the `basicAllocator` used to supply memory&period; If `basicAllocator` is not specified, a default&hyphen;constructed allocator is used&period; The contents of `original` are moved (in constant time) to the new string if `basicAllocator &equals;&equals; original&period;get&lowbar;allocator()`, and are copied (in linear time) using `basicAllocator` otherwise&period; `original` is left in a valid but unspecified state&period; Throw `out&lowbar;of&lowbar;range` if `position &gt; original&period;length()`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
basic&lowbar;string(
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;basic&lowbar;string&lt;char32&lowbar;t&gt;&gt;] original,
    xref:bsl/basic_string-0f3/size_type.adoc[size&lowbar;type] position,
    xref:bsl/allocator-0df.adoc[allocator&lt;char32&lowbar;t&gt;] const& basicAllocator = ALLOCATOR());
----


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