c++ char* contains code example
Example 1: 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";
Example 2: c++ contains
if (s1.find(s2) != std::string::npos) {
std::cout << "found!" << '\n';
}