stl:find _first_of与search用法

来源:互联网 发布:怎么上传图片到淘宝 编辑:程序博客网 时间:2024/06/07 09:01
#include<iostream>  #include<string>  #include<algorithm>  using namespace std;      int main()  {    string str("i love you");  string str1 = "youf";    string::iterator ix = search(str.begin(), str.end(), str1.begin(), str1.end());    if (ix == str.end())  cout << "connot find it" << endl;  else  cout << ix-str.begin();        int n=str.find_first_of("sdaadosf");      cout << n << endl;  } 

原创粉丝点击