The C function strstr() tells you if a string exists within another string, e.g. strstr("Peter","Peter 25 m") would return TRUE. I'm not sure if std::string has anything like that; if not then you would need to call c_str() for the parameters to strstr().