Erase characters from this string.
Synopsis
Declared in <bslstl_string.h>
basic_string&
erase(
size_type position = 0,
size_type numChars = npos);
Description
Erase from this string the substring of length the optionally specified numChars or original.length() ‐ position, whichever is smaller, starting at the optionally specified position. If position is not specified, the first position is used (i.e., position is set to 0). Return a reference providing modifiable access to this string. If numChars equals npos, then the remaining length of the string is erased (i.e., numChars is set to length() ‐ position). Throw out_of_range if position > length().
Return Value
reference providing modifiable access to this string
Parameters
Name |
Description |
position |
starting index |
numChars |
number of characters |
Created with MrDocs