stringstream erase last character code example
Example 1: delete last char of string C++
st = myString.substr(0, myString.size()-1);
Example 2: remove something from stringstream
stringstream ss;
ss<<"abc\n";
ss.seekp(-1, std::ios_base::end);
ss << '\0';