Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //字串搜尋
- #include <iostream>
- #include <iostream>
- using namespace std;
- int main()
- {
- string s1="this is s1",s2="is";
- int target=s1.find(s2);
- if(target==string::npos)
- cout<<"can't find\n";
- else
- cout<<"first is at "<<target<<endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment