【c++】C++中erase的用法

erase一共三种用法:
1.erase(pos,n);
删除从下标pos开始的n个字符,比如erase(0,1)就是删除第一个字符
2.erase(position);
删除postion处的一个字符(position是一个string类型的迭代器)
3.erase(first,last)
删除从first到last之间的字符(first和last都是迭代器)

原文地址:https://www.cnblogs.com/opensmarty/p/15108563.html