#include<iostream>
#include<string>
using namespace std;
//string字符串拼接
void test01()
{
string str1 = "我";
str1 += "爱玩游戏";
cout << str1 << endl;
str1 += ':';
cout << str1 << endl;
string str2="LOL DNF";
str1 += str2;
cout << str1 << endl;
string str3 = "I";
str3.append(" love ");
cout << str3 << endl;
str3.append("game abcde", 4);
cout << str3 << endl;
//str3.append(str2);
//str3.append(str2, 0, 3); //从第0个位置开始 截取3个字符 即截取LOL
str3.append(str2, 4, 3); //从第4个位置开始 截取3个字符 即截取DNF
//str3.append(参数1,参数2,参数3)参数2是从哪个位置开始截取 参数3是截取的字符个数
cout << str3 << endl;
}
int main()
{
test01();
system("pause");
return 0;
}