| Home | Libraries | People | FAQ | More

##### basic_static_string::replace (7 of 14 overloads)

Replace a part of the string.

###### Synopsis

    constexpr basic_static_string&
    replace(
        basic_static_string::size_type pos,
        basic_static_string::size_type n1,
        basic_static_string::size_type n2,
        basic_static_string::value_type c);

###### Description

Replaces `rcount` characters starting at index `pos` with `n2` copies of `c`, where `rcount` is `std::min(n1, size() - pos)`.

###### Exception Safety

Strong guarantee.

###### Remarks

All references, pointers, or iterators referring to contained elements are invalidated. Any past-the-end iterators are also invalidated.

###### Return Value

`*this`

###### Parameters

Name | Description
--- | ---
`pos` | The index to replace at.
`n1` | The number of characters to replace.
`n2` | The number of characters to replace with.
`c` | The character to replace with.

###### Exceptions

Type | Thrown On
--- | ---
`std::length_error` | `size() + (n2 - rcount) > max_size()`
`std::out_of_range` | `pos > size()`