Answers for "check if a string is a prefix of another c++"

C++
0

check if a string is a prefix of another c++

std::string prefix = "foo";
std::string string = "foobar";

bool isPrefix = std::mismatch(prefix.begin(), prefix.end(),
    string.begin(), string.end()).first == prefix.end();
Posted by: Guest on July-30-2021

Code answers related to "check if a string is a prefix of another c++"

Browse Popular Code Answers by Language