[#bsl-basic_string-0e-insert-0a1] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-0e.adoc[basic_string<wchar_t>]::insert :relfileprefix: ../../ :mrdocs: Insert at the specified `position` in this string the optionally specified `numChars` characters starting at the specified `sourcePosition` in the specified `other` string, or the suffix of `other` starting at `sourcePosition` if `sourcePosition + numChars > other.length()`. If `numChars` is not specified, `npos` is used. Return a reference providing modifiable access to this string. Throw `out_of_range` if `position > length()` or `sourcePosition > other.length()`. == Synopsis Declared in `<bslstl_string.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string<wchar_t>]& insert( xref:bsl/basic_string-0e/size_type.adoc[size_type] position, xref:bsl/basic_string-0faf.adoc[basic_string<wchar_t>] const& other, xref:bsl/basic_string-0e/size_type.adoc[size_type] sourcePosition, xref:bsl/basic_string-0e/size_type.adoc[size_type] numChars = npos); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#