| Home | Libraries | People | FAQ | More

###### string::insert (2 of 4 overloads)

Insert a character.

###### Synopsis

    string&
    insert(
        std::size_t pos,
        std::size_t count,
        char ch);

###### Description

Inserts `count` copies of `ch` at the position `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 insert at.
`count` | The number of characters to insert.
`ch` | The character to insert.

###### Exceptions

Type | Thrown On
--- | ---
`system_error` | `size() + count > max_size()`
`system_error` | `pos > size()`