Deleting Part of the Value of a String: erase()
Removing characters from a string can be done using erase(). This member function takes two parameters, the starting position and the number of characters to remove.
Syntax: source.erase(start_pos, numchars);
The erase() function removes the characters and closes up the string. If the second parameter is omitted, the function erases characters from the starting position to the end of the string.
Post A Comment:
0 comments: