string::copy

## `string::copy`

Copy a substring to another string.

### Synopsis

    std::size_t
    copy(
        char* dest,
        std::size_t count,
        std::size_t pos = 0) const;

### Description

Copies `std::min(count, size() - pos)` characters starting at index `pos` to the string pointed to by `dest`.

| This function doesn’t put the null terminator after the copied characters.

### Return Value

The number of characters copied.

### Parameters

Name | Description
--- | ---
`count` | The number of characters to copy.
`dest` | The string to copy to.
`pos` | The index to begin copying from.

### Exceptions

Type | Thrown On
--- | ---
`boost::system::system_error` | `pos >` `max_size()`.

Edit this page