I want to know if a string has any digits, or if there are no digits. Is there a function that easily does this?
#include #include #include if (std::find_if(s.begin(), s.end(), (int(*)(int))std::isdigit) != s.end()) { // contains digit }