博客
关于我
C++的string
阅读量:411 次
发布时间:2019-03-06

本文共 299 字,大约阅读时间需要 1 分钟。

string中find()返回值是字母在母串中的位置(下标记录),如果没有找到,返回npos。
string的substr(pos=0, count=npos)返回字符串[pos, pos+count)

string& erase (size_t pos = 0, size_t len = npos); //如果是int类型的话,str.erase(pos)是从pos位置开始删除到最后,因为默认len=pos,等于字符串的长度.

character (2)
iterator erase (const_iterator p);//注意类型,const_iterator 类型时是删除指定的位置.

转载地址:http://orfkz.baihongyu.com/

你可能感兴趣的文章
Mysql之主从复制
查看>>