#include <string> #include <algorithm> #include <iostream> using namespace std; int main () { string strSample ("Hello String!"); strSample.erase (strSample.begin (), strSample.end ()); if (strSample.length () == 0) cout << "The string is empty" << endl; return 0; }