xxxxxxxxxx
bool is_digits(const std::string &str)
{
return std::all_of(str.begin(), str.end(), ::isdigit); // C++11
}
xxxxxxxxxx
if (stringVariable.find_first_not_of("0123456789.-") == std::string::npos){
return true;
}
else {
return false;
}