一、使用时需添加头文件#include<string>

二、在string对象尾部追加字符串

    STL学习小结之string

三、删除string对象

1.如果要清空string对象,直接赋值为空就行。

2.用erase()方法删除迭代器所指的区间内的元素。

四、length()方法返回string对象的长度。 

五、替换string对象的字符

    STL学习小结之string

六、搜索string对象中的内容。

 STL学习小结之string


相关文章: