码迷,mamicode.com
首页 > 其他好文 > 详细

string::rfind

时间:2019-12-19 19:13:41      阅读:92      评论:0      收藏:0      [点我收藏+]

标签:str   char*   sans   pre   exce   int   ott   char   clu   

string (1)
size_t rfind (const string& str, size_t pos = npos) const noexcept;
c-string (2)
size_t rfind (const char* s, size_t pos = npos) const;
buffer (3)
size_t rfind (const char* s, size_t pos, size_t n) const;
character (4)
size_t rfind (char c, size_t pos = npos) const noexcept;:

#include <iostream>
#include <string>
using namespace std;
int main()
{
string s1 = "lyy is mulushu, but lyy is quiet";
string s2 = "lyy";
const char *s3 = "lyy";
cout << s1.rfind(s2) << endl;
cout << s1.rfind(s2, 30) << endl;
cout << s1.rfind(s3, 40, 2) << endl;
cout << s1.rfind(s3, 40, 3) << endl;
cout << s1.rfind(‘t‘, 20) << endl;
return 0;
}

string::rfind

标签:str   char*   sans   pre   exce   int   ott   char   clu   

原文地址:https://www.cnblogs.com/xpylovely/p/12069451.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!