第十八章 9string类的erase成员函数的使用

// 9 string类的erase成员函数的使用
/*
#include <iostream>
#include <string>
using namespace std;
int main()
{
    string s = "give me";
	cout<<"原始字符串为:"<<s<<endl;
	s.erase(1,3); //炎1开始删除三个字符
	cout<<"原始字符串为:"<<s<<endl;
	s.erase(2); //删除二个字符,从后面开始的样
	cout<<"原始字符串为:"<<s<<endl;
	s.erase();//删除所有
	cout<<"原始字符串为:"<<s<<endl;
	
	return 0;
	
}*/

  

posted @ 2012-09-23 15:47  简单--生活  阅读(255)  评论(0编辑  收藏  举报
简单--生活(CSDN)