bsl::basic_string::replace

replace overloads

Synopses

Declared in <bslstl_string.h>

Replace a substring of this string.

basic_string&
replace(
    const_iterator first,
    const_iterator last,
    basic_string const& replacement);
» more...

Replace a substring of this string.

basic_string&
replace(
    const_iterator first,
    const_iterator last,
    CHAR_TYPE const* characterString);
» more...

Replace a substring of this string.

basic_string&
replace(
    size_type outPosition,
    size_type outNumChars,
    basic_string const& replacement);
» more...

Replace a substring of this string.

basic_string&
replace(
    size_type outPosition,
    size_type outNumChars,
    CHAR_TYPE const* characterString);
» more...

Replace a substring of this string.

template<class STRING_VIEW_LIKE_TYPE>
basic_string&
replace(
    const_iterator first,
    const_iterator last,
    STRING_VIEW_LIKE_TYPE const& replacement);
» more...

Replace a substring with the specified replacement.

template<class STRING_VIEW_LIKE_TYPE>
basic_string&
replace(
    size_type outPosition,
    size_type outNumChars,
    STRING_VIEW_LIKE_TYPE const& replacement);
» more...

Replace a substring of this string.

basic_string&
replace(
    const_iterator first,
    const_iterator last,
    size_type numChars,
    CHAR_TYPE character);
» more...

Replace a substring of this string.

basic_string&
replace(
    const_iterator first,
    const_iterator last,
    CHAR_TYPE const* characterString,
    size_type numChars);
» more...

Replace a substring of this string.

basic_string&
replace(
    size_type outPosition,
    size_type outNumChars,
    size_type numChars,
    CHAR_TYPE character);
» more...

Replace a substring of this string.

basic_string&
replace(
    size_type outPosition,
    size_type outNumChars,
    CHAR_TYPE const* characterString,
    size_type numChars);
» more...

Replace a substring of this string.

template<class INPUT_ITER>
basic_string&
replace(
    const_iterator first,
    const_iterator last,
    INPUT_ITER stringFirst,
    INPUT_ITER stringLast);
» more...

Replace a substring of this string.

basic_string&
replace(
    size_type outPosition,
    size_type outNumChars,
    basic_string const& replacement,
    size_type position,
    size_type numChars = npos);
» more...

Replace a substring of this string.

template<class STRING_VIEW_LIKE_TYPE>
basic_string&
replace(
    size_type outPosition,
    size_type outNumChars,
    STRING_VIEW_LIKE_TYPE const& replacement,
    size_type position,
    size_type numChars = npos);
» more...

Return Value

  • reference providing modifiable access to this string
  • reference to this string

Parameters

NameDescription
firstbeginning of the range (inclusive)
lastend of the range (exclusive)
replacementreplacement character sequence
characterStringpointer to characters
outPositionindex at which replacement begins
outNumCharsnumber of characters to replace
numCharsnumber of characters
charactercharacter value
stringFirstbeginning of the replacement range
stringLastend of the replacement range
positionstarting index