Replace a substring of this string.
Synopsis
Declared in <bslstl_string.h>
basic_string&
replace(
const_iterator first,
const_iterator last,
CHAR_TYPE const* characterString,
size_type numChars);
Description
Replace the substring in the range starting at the specified first position and ending right before the specified last position with the specified initial numChars characters in the specified characterString. 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 characterString is at least numChars long.
Return Value
reference providing modifiable access to this string
Parameters
Name |
Description |
first |
beginning of the range (inclusive) |
last |
end of the range (exclusive) |
characterString |
pointer to characters |
numChars |
number of characters |
Created with MrDocs