string
append()
可用于向string对象后面接char
string s = "Hello World";
s.append(10, '!');
cout << s << endl;
输出: Hello World!!!!!!!!!!
push_back(char c)
可用于向string对象后面接char
string s = "Hello World";
s.push_back('!');
cout << s << endl;
输出: Hello World!
substr()
可用于截取子串
string s = "123456789";
int len = s.size();
s += "->0";
cout << s.substr(0, len) << endl;
输出: 123456789