Replace a substring of this string.
Declared in <bslstl_string.h>
template<class INPUT_ITER>
basic_string&
replace(
const_iterator first,
const_iterator last,
INPUT_ITER stringFirst,
INPUT_ITER stringLast);
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.
reference providing modifiable access to this string
| Name | Description |
|---|---|
| first | beginning of the range (inclusive) |
| last | end of the range (exclusive) |
| stringFirst | beginning of the replacement range |
| stringLast | end of the replacement range |