bsl::basic_string::erase

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

Synopsis

Declared in <bslstl_string.h>

iterator
erase(
    const_iterator first,
    const_iterator last);

Description

Return an iterator providing modifiable access to the character at the last position prior to erasing. If no such character exists, return end(). This method invalidates existing iterators pointing to first or a subsequent position. The behavior is undefined unless first and last are both within the range [cbegin() .. cend()] and `first <= last`.

Return Value

iterator following the last removed character

Parameters

NameDescription
firstbeginning of the range to erase
lastend of the range to erase