Search from the end : string find « String « C++
- C++
- String
- string find
Search from the end
#include <string>
#include <iostream>
int main( ) {
std::string s = "Search from the beginning";
std::cout << s.rfind("ar") << '\n'; // Search from the end
}
/*
2
*/
Related examples in the same category