void pop_back();//弹出最后一个字符
#include <string>#include <iostream>
using namespace std;int main(){ string str("hello world!"); str.pop_back(); cout << str << endl; return 0;}
string::pop_back
原文:https://www.cnblogs.com/xpylovely/p/12177955.html