#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;
}
stl:find _first_of与search用法
最新推荐文章于 2022-10-18 08:30:00 发布