Answers for "check if a string contains numbers cpp"

C++
7

c++ check if string contains substring

string str ("There are two needles in this haystack.");
string str2 ("needle");

if (str.find(str2) != string::npos) {
//.. found.
}
Posted by: Guest on December-23-2020
0

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

bool isParam (string line)
{
    if (isdigit(atoi(line.c_str())))
        return true;

    return false;
}
Posted by: Guest on October-21-2021

Code answers related to "check if a string contains numbers cpp"

Browse Popular Code Answers by Language