//modified by quanspace
/*从string对象中去掉标点符号。要求输入到程序中滴字符串必须含有
* 标点符号,输出结果则是去掉标点符号后的string 对象。
* */
# include <iostream>
# include <string>
using namespace std;
int main(){
string str = "enjoy ?><..coding, enjoy,.*@ playing!";
string::size_type i;
cout<<"the original string : "<<endl;
cout<<str<<endl;
cout<<"delete punctuation of the strings :"<<endl;
for(i = 0; i< str.size(); ++i){//ispunc() 是判断字符串中是否有标点符号
if(!ispunct(str[i]))
cout<<str[i];
}
cout<<endl;
return 0;
}
