[#bsl-basic_string-0faf-replace-041] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-0faf.adoc[basic_string]::replace :relfileprefix: ../../ :mrdocs: Replace the substring in the range starting at the specified `first` position and ending right before the specified `last` position with the characters in the range starting at the specified `stringFirst` and ending right before the specified `stringLast` iterator, both of the (template parameter) type `INPUT_ITER`. Return a reference providing modifiable access to this string. The behavior is undefined unless `first` and `last` are both within the range `[cbegin() .. cend()]`, `first <= last`, and `stringFirst` and `stringLast` refer to a sequence of valid values where `stringFirst` is at a position at or before `stringLast`. == Synopsis Declared in `<bslstl_string.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITER> 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, INPUT_ITER stringFirst, INPUT_ITER stringLast); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#