Share via


basic_string::replace

basic_string::replace

basic_string& replace(size_type p0, size_type n0,
    const E *s);
basic_string& replace(size_type p0, size_type n0,
    const E *s, size_type n);
basic_string& replace(size_type p0, size_type n0,
    const basic_string& str);
basic_string& replace(size_type p0, size_type n0,
    const basic_string& str, size_type pos, size_type n);
basic_string& replace(size_type p0, size_type n0,
    size_type n, E c);
basic_string& replace(iterator first0, iterator last0,
    const E *s);
basic_string& replace(iterator first0, iterator last0,
    const E *s, size_type n);
basic_string& replace(iterator first0, iterator last0,
    const basic_string& str);
basic_string& replace(iterator first0, iterator last0,
    size_type n, E c);
basic_string& replace(iterator first0, iterator last0,
    const_iterator first, const_iterator last);

Each member function replaces up to n0 elements of the controlled sequence beginning with position p0, or the elements of the controlled sequence beginning with the one pointed to by first, up to but not including last. The replacement is the operand sequence specified by the remaining operands. The function then returns *this.

In this implementation, if a translator does not support member template functions, the template:

template<class InIt>
    basic_string& replace(iterator first0, iterator last0,
        InIt first, InIt last);

is replaced by:

basic_string& replace(iterator first0, iterator last0,
    const_iterator first, const_iterator last);