how to test if a string contains another string C++ code example
Example: 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";
std::string s = "Hello";
if (s.find('e') != std::string::npos)
cout << "Found";
else
cout << "Not Found";