How can I remove last character from a C++ string?
I tried st = substr(st.length()-1); But it didn\'t work.
st = substr(st.length()-1);
That's all you need:
#include //string::pop_back & string::empty if (!st.empty()) st.pop_back();