how to see substring in cpp code example Example: c++ check substring if (s1.find(s2) != std::string::npos) { std::cout << "found!" << '\n'; }