xxxxxxxxxx
bool is_number(const std::string& s)
{
std::string::const_iterator it = s.begin();
while (it != s.end() && std::isdigit(*it)) ++it;
return !s.empty() && it == s.end();
}
xxxxxxxxxx
bool isStringNumber(string str){
for(int i=0;i<str.length();i++){
if(str[i]<'0'||str[i]>'9'){
return false;
}
}
return true;
}
//Beleive in Allah!
//just my slogan
xxxxxxxxxx
bool isParam (string line)
{
if (isdigit(atoi(line.c_str())))
return true;
return false;
}
xxxxxxxxxx
if (stringVariable.find_first_not_of("0123456789.-") == std::string::npos){
return true;
}
else {
return false;
}