#include <iostream>
int main() {
std::string s = "C++ is a general-purpose programming language";
char ch = ' ';
size_t index = s.find_last_of(ch);
if (index == std::string::npos) {
std::cout << "Not found";
} else {
std::cout << "Found at index: " << index;
}
return 0;
}
/*
run:
Found at index: 36
*/