C++中string.find()函数与string::npos
查找字符串a是否包含子串b,
不是用strA.find(strB) > 0而是strA.find(strB) != string:nposstring::size_type pos = strA.find(strB);
if(pos != string::npos){}
----------
int idx = str.find("abc");
if (idx == string::npos)…
转载
2017-12-02 20:50:37 ·
307 阅读 ·
0 评论