bsl::basic_string::append

Append a substring of suffix to this string.

Synopsis

Declared in <bslstl_string.h>

basic_string&
append(
    basic_string const& suffix,
    size_type position,
    size_type numChars = npos);

Description

Append to this string the optionally specified numChars characters starting at the specified position in the specified suffix, or the tail of suffix starting at position if `position + numChars > suffix.length(). If numChars is not specified, npos` is used. Return a reference providing modifiable access to this string. Throw out_of_range if position > suffix.length().

Return Value

a reference to this string

Parameters

NameDescription
suffixstring providing the characters to append
positionstarting index in suffix
numCharsnumber of characters to append