[#bsl-basic_string-0f3-replace-02] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-0f3.adoc[basic_string<char32_t>]::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 `replacement`, and return a reference providing modifiable access to this string. Throw `out_of_range` if `outPosition > length()`. == Synopsis Declared in `<bslstl_string.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class STRING_VIEW_LIKE_TYPE> xref:bsl/basic_string-0faf.adoc[basic_string<char32_t>]& replace( xref:bsl/basic_string-0f3/size_type.adoc[size_type] outPosition, xref:bsl/basic_string-0f3/size_type.adoc[size_type] outNumChars, STRING_VIEW_LIKE_TYPE const& replacement); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#