标签:cout names str int end pac out size_t ace
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s1("abcdemyyngl");
string s2("mngf");
size_t n = s1.find_last_not_of(s2);
cout << n << endl;
n = s1.find_last_not_of(s2, 6); //在s2中查找s1位置6之前的每个字符
cout << n << endl;
const char *s3 = "ghijy";
cout << s1.find_last_not_of(s3, 6) << endl;
cout << s1.find_last_not_of(s3, 5, 4) << endl;在s3的前4个字符中查找s1位置5前的字符
cout << s1.find_last_not_of(‘l‘, 8) << endl;
cout << s1.find_last_not_of(‘l‘, 7) << endl;
cout << s1.find_last_not_of(‘l‘) << endl;
return 0;
}
标签:cout names str int end pac out size_t ace
原文地址:https://www.cnblogs.com/xpylovely/p/12090830.html