bsl::basic_string::erase

erase overloads

Synopses

Declared in <bslstl_string.h>

Erase characters from this string.

iterator
erase(const_iterator position);
» more...

Erase the substring in the half-open range [first, last)].

iterator
erase(
    const_iterator first,
    const_iterator last);
» more...

Erase characters from this string.

basic_string&
erase(
    size_type position = 0,
    size_type numChars = npos);
» more...

Return Value

  • iterator following the last removed character
  • reference providing modifiable access to this string

Parameters

NameDescription
positionstarting index
firstbeginning of the range to erase
lastend of the range to erase
numCharsnumber of characters