Given a string \"filename.conf\", how to I verify the extension part?
\"filename.conf\"
I need a cross platform solution.
Is this too simple of a solution?
#include #include int main() { std::string fn = "filename.conf"; if(fn.substr(fn.find_last_of(".") + 1) == "conf") { std::cout << "Yes..." << std::endl; } else { std::cout << "No..." << std::endl; } }