find text in string c++ true false

include

include

int main() { std::string text = "This is a C++ string search example"; std::string search = "C++"; bool found = text.find(search) != std::string::npos; std::cout << "Text found in string: " << (found ? "true" : "false") << std::endl; return 0; }