功能
使用
string s("abcdABCD123");
string::size_type position = s.find_last_of("123");
例子说明
# include<iostream>
# include<algorithm>
using namespace std;
int main(void)
{
////find函数返回类型 size_type
string s("abcdABCD123");
string::size_type position;
//find 函数返回 AB 在 s 中的下标位置
position = s.find_last_of("123");
printf("s.find_last_of(\"123\") is :%d\n", position);
}
输出结果:
s.find_last_of(“123”) is :10