// string::erase
#include <iostream>
#include <string>
usingnamespace std;
int main ()
{
string str ("This is an example phrase.");
string::iterator it;
// erase used in the same order as described above:
//删除从位置10(从0开始算的,T为第一个位置0)开始的e之后的8个字符"example "
str.erase (10,8);
cout << str << endl; // "This is an phrase."