[#bsl-basic_string-0e-replace-07]
= xref:bsl.adoc[bsl]::xref:bsl/basic_string-0e.adoc[basic&lowbar;string&lt;wchar&lowbar;t&gt;]::replace
:relfileprefix: ../../
:mrdocs:

Replace the specified `outNumChars` characters starting at the specified `outPosition` in this string (or the suffix of this string starting at `outPosition` if `outPosition &plus; outNumChars &gt; length()`) with the specified initial `numChars` characters in the specified `characterString`&period; Return a reference providing modifiable access to this string&period; Throw `out&lowbar;of&lowbar;range` if `outPosition &gt; length()`&period; The behavior is undefined unless `characterString` is at least `numChars` long&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&lt;wchar&lowbar;t&gt;]&
replace(
    xref:bsl/basic_string-0e/size_type.adoc[size&lowbar;type] outPosition,
    xref:bsl/basic_string-0e/size_type.adoc[size&lowbar;type] outNumChars,
    wchar&lowbar;t const* characterString,
    xref:bsl/basic_string-0e/size_type.adoc[size&lowbar;type] numChars);
----


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