C++ 提高教程 STL -String 字符串删除和存取

 

# include<iostream>
# include<string>
using namespace std;

void test01()
{
	string str1 = "Hello";
	cout << "str1:" << str1 << endl;
	str1.insert(1, "111");
	cout << "str1:" << str1 << endl;
	str1.erase(1, 3);
	cout << "str1:" << str1 << endl;
}
int main()
{
	test01();
	system("pause");
	return 0;
}
全部评论

相关推荐

嗨害嗨我来了:你跟他说开迈巴赫呢,一个月好几万,让学弟尝尝一点小小的社会险恶
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务