The rfind() Function
◀ The find() Function▶ The erase() Function Amazon
The
rfind() function work like
find() functions (‘r’ means reverse) except that by default they start the search at the end of the invoking string, going in the left direction. So essentially they are trying to find the last occurrence of the given string or character.
They have the identical argument signatures as
find() functions except that the default
pos value is
string::npos, indicating that the search begins at the end and going in the left direction.
Next let’s look at how you can remove a string from another string!
◀ The find() Function▶ The erase() Function