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
To optimize a little bit:
if ( smallString.size() <= bigString.size() && strncmp( smallString.c_str(), bigString.c_str(), smallString.length() ) == 0 )
Don't forget to #include or #include
#include