Use std::string::find instead of iterating the stringg