Вы можете использовать std::count_if
std::vector<std::string> v { "this is a line", "foo", "This is another line" };
auto count = std::count_if(std::begin(v), std::end(v), [](auto const& s) {
return s.find("line") != std::string::npos;
});
std::cout << count;