# include<iostream>
# include<string>
using namespace std;
//string字符串拼接
void test01()
{
string str1 = "我";
str1 += "爱玩游戏";
cout << str1<< endl;
str1 += ":";
cout << "str1 =" << str1 << endl;
string str2 = "LOL DNF";
str1 += str2;
cout << "str1 =" << str1 << endl;
string str3 = "I";
str3.append(" Love");
str3.append(" Game abcde",5);
cout << "str3 =" << str3 << endl;
str3.append(str2);
cout << "str3 =" << str3 << endl;
str3.append(str2,4,3);
cout << "str3 =" << str3 << endl;
}
int main()
{
test01();
system("pause");
return 0;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)