#include <iostream>
using namespace std;
int main() {
string s = "Hello World!";
int pos = s.find_last_of("H");
cout << pos << endl; // 0
cout << s.find_last_of("l") << endl; // 9
cout << s.find_last_of("ll") << endl; // 9
cout << s.find_last_of("llll") << endl; // 9
cout << s.find_last_of("e") << endl; // 1
cout << s.find_last_of("z") << endl; // 18446744073709551615
}
#include <iostream>
#include <string>
#include <cstddef>
using namespace std;
void SplitFilename(const string& str) {
size_t pos = str.find_last_of("/\\");
cout << str.substr(0, pos) << ", " << str.substr(pos+1) << '\n';
}
int main () {
SplitFilename("/usr/bin/man"); // /usr/bin, man
SplitFilename("c:\\windows\\winhelp.exe"); // c:\windows, winhelp.exe
}