[#bsl-basic_string-0fb-replace-00] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-0fb.adoc[basic_string<char>]::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 + outNumChars > length()`) with the specified initial `numChars` characters in the specified `characterString`. Return a reference providing modifiable access to this string. Throw `out_of_range` if `outPosition > length()`. The behavior is undefined unless `characterString` is at least `numChars` long. == Synopsis Declared in `<bslstl_string.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string<char>]& replace( xref:bsl/basic_string-0fb/size_type.adoc[size_type] outPosition, xref:bsl/basic_string-0fb/size_type.adoc[size_type] outNumChars, char const* characterString, xref:bsl/basic_string-0fb/size_type.adoc[size_type] numChars); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#