[#bsl-basic_string-0f3-erase-07]
= xref:bsl.adoc[bsl]::xref:bsl/basic_string-0f3.adoc[basic&lowbar;string&lt;char32&lowbar;t&gt;]::erase
:relfileprefix: ../../
:mrdocs:

Erase from this string a substring defined by the specified pair of `first` and `last` iterators within this string&period; Return an iterator providing modifiable access to the character at the `last` position prior to erasing&period; If no such character exists, return `end()`&period; This method invalidates existing iterators pointing to `first` or a subsequent position&period; The behavior is undefined unless `first` and `last` are both within the range `&lsqb;cbegin() &period;&period; cend()&rsqb;` and &grave;first &lt;&equals; last&grave;&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;string&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_string-0f3/iterator.adoc[iterator]
erase(
    xref:bsl/basic_string-0f3/const_iterator.adoc[const&lowbar;iterator] first,
    xref:bsl/basic_string-0f3/const_iterator.adoc[const&lowbar;iterator] last);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
