📅  最后修改于: 2022-03-11 14:44:47.215000             🧑  作者: Mango
std::string prefix = "foo";
std::string string = "foobar";
bool isPrefix = std::mismatch(prefix.begin(), prefix.end(),
string.begin(), string.end()).first == prefix.end();