bsl::basic_string::insert

Insert characters into this string.

Synopsis

Declared in <bslstl_string.h>

basic_string&
insert(
    size_type position,
    size_type numChars,
    CHAR_TYPE character);

Description

Insert at the specified position in this string the specified numChars copies of the specified character, and return a reference providing modifiable access to this string. Throw out_of_range if position > length().

Return Value

reference providing modifiable access to this string

Parameters

NameDescription
positionstarting index
numCharsnumber of characters
charactercharacter value