| Home | Libraries | People | FAQ | More

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

Replace a part of the string.

###### Synopsis

    constexpr basic_static_string&
    replace(
        size_type pos,
        size_type n1,
        const_pointer s);

###### Description

Replaces `rcount` characters starting at index `pos` with those of `{s, s + len)`, where the length of the string `len` is `traits_type::length(s)` and `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.
`s` | The string to replace with.

###### Exceptions

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