string
string erase(int pos = 0, int n = 长度);
//删除pos开始的n个字符,返回修改后的字符串
str.erase(0,n)
string insert(int p0,const string &s, int pos, int n);
//在p0位置插入字符串s中pos开始的前n个字符
string insert(int p0,const string &s);
注意参数是字符串
str.insert(0,“love”)
string substr(int pos = 0,int n = 长度);
str.substr(0,4)
int find(char c, int pos = 0) ;
//从pos开始查找字符c在当前字符串的位置,参数可有可无
int find(const char *s, int pos = 0) const;
//从pos开始查找字符串s在当前串中的位置
查找成功时返回所在位置,失败返回string::npos的值
int find_first_of(char c, int pos = 0) const;//从pos开始查找字符c第一次出现的位置
int find_first_of(const char *s, int pos = 0) const;
int find_last_of(char c, int pos = npos) const;
int find_last_of(const char *s, int pos = npos) const;
string replace(int p, int n,const char *s);
//删除从p开始的n个字符,然后在p处插入串s
string &replace(int p, int n,const char *s, int n);//删除p开始的n个字符,然后在p处插入字符串s的前n个字符
string &replace(int p, int n,int n, char c);//删除0开始的n个字符,然后在p处插入n个字符c