remove char from stringstream and append some data

后端 未结 9 1510
情深已故
情深已故 2020-12-31 01:42

In my code there is a loop that adds sth like that \"number,\" to stringstream. When it ends, I need to extract \',\' add \'}\' and add \'{\' if the loop is to repeated.

9条回答
  •  星月不相逢
    2020-12-31 02:10

    You could use std::string::erase to remove the last character directly from the underlying string.

提交回复
热议问题