[#bsl-basic_string-0faf-replace-093] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-0faf.adoc[basic_string]::replace :relfileprefix: ../../ :mrdocs: Replace a substring of this string. == Synopsis Declared in `<bslstl_string.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string]& replace( xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] first, xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] last, xref:bsl/basic_string-0faf/size_type.adoc[size_type] numChars, CHAR_TYPE character); ---- == Description Replace the substring in the range starting at the specified `first` position and ending right before the specified `last` position with the specified `numChars` copies of the specified `character`. Return a reference providing modifiable access to this string. The behavior is undefined unless `first` and `last` are both within the range `[cbegin() .. cend()]` and `first <= last`. == Return Value reference providing modifiable access to this string == Parameters [cols="1,4"] |=== | Name| Description | *first* | beginning of the range (inclusive) | *last* | end of the range (exclusive) | *numChars* | number of characters | *character* | character value |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#