[#bsl-basic_string-0faf-erase-04] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-0faf.adoc[basic_string]::erase :relfileprefix: ../../ :mrdocs: `erase` overloads == Synopses Declared in `<bslstl_string.h>` Erase characters from this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf/iterator.adoc[iterator] xref:bsl/basic_string-0faf/erase-0d.adoc[erase](xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] position); ---- [.small]#xref:bsl/basic_string-0faf/erase-0d.adoc[_» more..._]# Erase the substring in the half‐open range `[first, last)]`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf/iterator.adoc[iterator] xref:bsl/basic_string-0faf/erase-0c.adoc[erase]( xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] first, xref:bsl/basic_string-0faf/const_iterator.adoc[const_iterator] last); ---- [.small]#xref:bsl/basic_string-0faf/erase-0c.adoc[_» more..._]# Erase characters from this string. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf.adoc[basic_string]& xref:bsl/basic_string-0faf/erase-09.adoc[erase]( xref:bsl/basic_string-0faf/size_type.adoc[size_type] position = 0, xref:bsl/basic_string-0faf/size_type.adoc[size_type] numChars = npos); ---- [.small]#xref:bsl/basic_string-0faf/erase-09.adoc[_» more..._]# == Return Value * iterator following the last removed character * reference providing modifiable access to this string == Parameters [cols="1,4"] |=== | Name| Description | *position* | starting index | *first* | beginning of the range to erase | *last* | end of the range to erase | *numChars* | number of characters |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#