bsl::basic_string<char32_t>::replace

replace overloads

Synopses

Declared in <bslstl_string.h>

Replace the substring in the range starting at the specified first position and ending right before the specified last position with the specified replacement string. 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.

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

Replace the substring in the range starting at the specified first position and ending right before the specified last position with the specified null-terminated characterString (of length CHAR_TRAITS::length(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()] and first <= last.

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

Replace the specified outNumChars characters starting at the specified outPosition in this string (or the suffix of this string starting at outPosition if outPosition + outNumChars > length()) with the specified replacement string, and return a reference providing modifiable access to this string. Throw out_of_range if outPosition > length().

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

Replace the specified outNumChars characters starting at the specified outPosition in this string (or the suffix of this string starting at outPosition if outPosition + outNumChars > length()) with the specified null-terminated characterString (of length CHAR_TRAITS::length(characterString)). Return a reference providing modifiable access to this string. Throw out_of_range if outPosition > length().

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

Replace the substring in the range starting at the specified first position and ending right before the specified last position with the specified replacement. 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.

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

Replace the specified outNumChars characters starting at the specified outPosition in this string (or the suffix of this string starting at outPosition if outPosition + outNumChars > length()) with the specified replacement, and return a reference providing modifiable access to this string. Throw out_of_range if outPosition > length().

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

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.

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

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.

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

Replace the specified outNumChars characters starting at the specified outPosition in this string (or the suffix of this string starting at outPosition if outPosition + outNumChars > length()) with the specified numChars copies of the specified character. Return a reference providing modifiable access to this string. Throw out_of_range if outPosition > length().

basic_string<char32_t>&
replace(
    size_type outPosition,
    size_type outNumChars,
    size_type numChars,
    char32_t character);
» more...

Replace the specified outNumChars characters starting at the specified outPosition in this string (or the suffix of this string starting at outPosition if outPosition + outNumChars > length()) with the specified initial numChars characters in the specified characterString. Return a reference providing modifiable access to this string. Throw out_of_range if outPosition > length(). The behavior is undefined unless characterString is at least numChars long.

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

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.

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

Replace the specified outNumChars characters starting at the specified outPosition in this string (or the suffix of this string starting at outPosition if outPosition + outNumChars > length()) with the optionally specified numChars characters starting at the specified position in the specified replacement string (or the suffix of replacement starting at position if position + numChars > replacement.length()). If numChars is not specified, npos is used. Return a reference providing modifiable access to this string. Throw out_of_range if outPosition > length() or position > replacement.length().

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

Replace the specified outNumChars characters starting at the specified outPosition in this string (or the suffix of this string starting at outPosition if outPosition + outNumChars > length()) with the optionally specified numChars characters starting at the specified position in the specified replacement (or the suffix of replacement starting at position if position + numChars > replacement.length()). If numChars is not specified, npos is used. Return a reference providing modifiable access to this string. Throw out_of_range if outPosition > length() or position > replacement.length().

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