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

Insert at the specified `position` in this string the specified `numChars` copies of the specified `character`, and return a reference providing modifiable access to this string&period; Throw `out&lowbar;of&lowbar;range` if `position &gt; length()`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_string-0faf.adoc[basic&lowbar;string]&
insert(
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] position,
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] numChars,
    CHAR&lowbar;TYPE character);
----


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