首页 > 其他 > 详细

string::find_last_not_of

时间:2019-12-24 13:18:13      阅读:117      评论:0      收藏:0      [点我收藏+]

#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;
}

string::find_last_not_of

原文:https://www.cnblogs.com/xpylovely/p/12090830.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!