Replace a substring of this string.
Declared in <bslstl_string.h>
template<class STRING_VIEW_LIKE_TYPE>
basic_string&
replace(
const_iterator first,
const_iterator last,
STRING_VIEW_LIKE_TYPE const& replacement);
Replace the substring in the range starting at the specified first position and ending right before the specified last position with the specified replacement. 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.
reference providing modifiable access to this string
| Name | Description |
|---|---|
| replacement | replacement character sequence |
| first | beginning of the range (inclusive) |
| last | end of the range (exclusive) |