c_字符串_从string对象中去掉标点符号
来源:互联网 发布:中国移动网络宽带电话 编辑:程序博客网 时间:2024/05/16 15:35
#include <iostream>#include <string>#include <cctype>using namespace std;int main(){ string s, result_str; bool has_punct = false; char ch; cout << "Enter a string:"<<endl; getline(cin, s); for (string::size_type index = 0; index < s.size(); ++index) { ch = s[index]; if (ispunct(ch)) has_punct = true; else result_str += ch; } if (has_punct) cout << "Result:" << endl << result_str << endl; else { cout << "No punctuation character in the string?!" << endl; system("pause"); return -1; } system("pause"); return 0;}
0 0
- c_字符串_从string对象中去掉标点符号
- 从string对象中去掉标点符号
- 从string对象中去掉标点符号
- string对象中去掉标点符号
- 编一个程序,从 string 对象中去掉标点符号。要求输入到程序的字符串必须含有标点符号,输出结果则是去掉标点符号后的 string 对象。
- Exercice_3.10_去掉string对象中的标点符号
- 如何去掉string对象中的标点符号?
- 去掉string中的标点符号
- python 对string去掉标点符号
- python 对string去掉标点符号
- C_字符串 PK string
- 删除字符串中标点符号
- 去掉字符串中的标点符号,以及特殊符号
- js 去掉字符串末尾的标点符号
- 如何从文件中读取字符串到string对象
- .net 去除字符串中标点符号
- 十六进制和字符串互相转换 去掉字符串中的标点符号
- 读入一个包含标点符号的字符串,将去掉标点符号之后的字符串输出
- 利用Bamboo创建build plan-和github连接
- Java OCR tesseract 图像智能字符识别技术 Java代码实现(二)
- OSG Shader GLSL 4.3 使用纹理 例子
- 安卓第三记
- Android屏幕适配
- c_字符串_从string对象中去掉标点符号
- LinearLayout 对各种layout_width/height的展现
- 社説 20150309 自民党大会 1強に慢心せず改革断行せよ
- mysql查看建表语句和查看表结构
- Android的几种数据存储方式
- sicily-1001 alphacode
- C++ Primer学习总结 第12章 动态内存
- spark stream初探
- 华为嵌入式面试题及参考答案