#include
#include
using namespace std;
int main(){
//字符创的拼接
string a = “rtmp://192.168.0.128:1935/live/Test”;
string b = “.flv”;
a.append(b);
cout<<a<<endl;
string str;
str.assign(a); //直接赋值
str.assign(str, 4, str.npos); //赋值给子串
string str1 = “http”;
str1.append(str);
cout << str1 << endl;
system(“pause”);
return 0;
}
输出:
rtmp://192.168.0.128:1935/live/Test.flv
http://192.168.0.128:1935/live/Test.flv
请按任意键继续. . .