c++ remove last character code example
Example 1: remove last character from string c++
st = myString.substr(0, myString.size()-1);
Example 2: remove last letter in string c++
#include <iostream>
#include <string>
str.resize(str.size() - 1);
st = myString.substr(0, myString.size()-1);
#include <iostream>
#include <string>
str.resize(str.size() - 1);