Это, конечно, возможно, и во многих отношениях, чем один. string.find()
возвращает позицию, поэтому
#include <iostream>
#include <string>
int main()
{
std::string str = "This is a test";
std::string::size_type pos = str.find("test");
if(pos != std::string::npos)
std::cout << str.substr(pos) << '\n';
}
или с итераторами, если вы боитесь, substr()
создаст ненужный временный
#include <iostream>
#include <string>
#include <iterator>
#include <algorithm>
int main()
{
std::string str = "This is a test";
std::string::size_type pos = str.find("test");
if(pos != std::string::npos)
copy(str.begin() + pos, str.end(),
std::ostream_iterator<char>(std::cout, ""));
}