Answers for "how to check string contains char in 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

Code answers related to "how to check string contains char in c++"

Browse Popular Code Answers by Language