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

Create a string that has the same value as the substring of the specified `numChars` length starting at the specified `position` in the specified `original` string&period; If `numChars` equals `npos`, then the remaining length of the string is used (i&period;e&period;, `numChars` is set to `original&period;length() &hyphen; position`)&period; Optionally specify the `basicAllocator` used to supply memory&period; If `basicAllocator` is not specified, a default&hyphen;constructed allocator is used&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:bsl/basic_string-0faf.adoc[basic&lowbar;string] const& original,
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] position,
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] numChars,
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----


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