c++ remove string until 5 characters left code example Example: delete last char of string C++ st = myString.substr(0, myString.size()-1);