#include <string> #include <iostream> int main( ) { std::string s = "Search from the beginning"; std::cout << s.rfind("ar") << '\n'; // Search from the end } /* 2 */