Answers for "chec if string contains numeric in c++"

C++
0

c++ function for checking if a sting is a number

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();
}
Posted by: Guest on October-21-2021
1

string c++ if letter or number

char test='a';
cout<<isalpha(test);
Posted by: Guest on August-20-2020

Code answers related to "chec if string contains numeric in c++"

Browse Popular Code Answers by Language