Answers for "check if character in string c++"

C++
4

how to check string contains char in c++

std::string s = "Hello";
if (s.find('e') != std::string::npos)
    cout << "Found";
else
    cout << "Not Found";
Posted by: Guest on August-23-2020
2

check if character in string c++

std::string s = "hell[o";
if (s.find('[') != std::string::npos)
    ; // found
else
    ; //
Posted by: Guest on September-14-2020

Code answers related to "check if character in string c++"

Browse Popular Code Answers by Language