Is there any way in C++ to check whether a string starts with a certain string (smaller than the original) ? Just like we can do in Java
bigString.startswi
The simplest approach would be:
if ( smallString.size() <= bigString.size() && std::equals( smallString.begin(), smallString.end(), bigString.end() )
(This will also work if one of the two, or both, is a vector. Or any other standard container type.)