c++ string comtain code example
Example 1: c++ contains
if (s1.find(s2) != std::string::npos) {
std::cout << "found!" << '\n';
}
Example 2: find in string c++
size_t find (const string& str, size_t pos = 0) const;
if (s1.find(s2) != std::string::npos) {
std::cout << "found!" << '\n';
}
size_t find (const string& str, size_t pos = 0) const;