Check out example codes for "c++ contains". It will help you in understanding the concepts better.

Code Example 1

if (string1.find(string2) != std::string::npos) {
    std::cout << "found!" << '\n';
}

Code Example 2

if (s1.find(s2) != std::string::npos) {
    std::cout << "found!" << '\n';
}

Learn ReactJs, React Native from akashmittal.com