bsl::basic_string::replace

Replace a substring of this string.

Synopsis

Declared in <bslstl_string.h>

basic_string&
replace(
    const_iterator first,
    const_iterator last,
    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

NameDescription
firstbeginning of the range (inclusive)
lastend of the range (exclusive)
numCharsnumber of characters
charactercharacter value