Strings In Depth7 / 15
Up next

contains

#include <print>
#include <string>

int main() {
    std::string s = "hello world";
    // std::string::contains was added in C++23
    std::println("{}", s.contains("world"));
    std::println("{}", s.contains("xyz"));
}
What you're solving

substring membership test (C++23)