String finder function
The answer to your primary question is yes, methods already exist in libraries that can do this. Reference this StackOverflow post.

Your method can then be simplified to what's shown below:

#include &lt;string&gt;

bool strfound(const std::string &amp;in, const std::string &amp;substr) {
    return in.find(substr) != std::string::npos;
}