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);

Replace a substring of this string.

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

Replace a substring of this string.

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

Replace a substring of this string.

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

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);

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);

Replace a substring of this string.

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

Replace a substring of this string.

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

Replace a substring of this string.

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

Replace a substring of this string.

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

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);

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);

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);

Return Value

  • reference providing modifiable access to this string

  • reference to this string

Parameters

Name

Description

first

beginning of the range (inclusive)

last

end of the range (exclusive)

replacement

replacement character sequence

characterString

pointer to characters

outPosition

index at which replacement begins

outNumChars

number of characters to replace

numChars

number of characters

character

character value

stringFirst

beginning of the replacement range

stringLast

end of the replacement range

position

starting index

Created with MrDocs