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

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

    STL学习小结之string

三、删除string对象

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

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

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

五、替换string对象的字符

    STL学习小结之string

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

 STL学习小结之string


相关文章:

  • 2021-06-26
  • 2021-05-26
  • 2021-07-09
  • 2021-09-17
  • 2021-12-06
猜你喜欢
  • 2021-11-11
  • 2021-11-07
  • 2022-12-23
  • 2021-08-08
相关资源
相似解决方案