博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
string类的字符串删除其中所有的空格
阅读量:4656 次
发布时间:2019-06-09

本文共 236 字,大约阅读时间需要 1 分钟。

int main()

{

  string title="This is a test string";

  string::iterator pos;  

  pos=remove(title.begin(),title.end(),' ');  

  title.erase(pos,title.end());

  cout<<title<<endl;

}

转载于:https://www.cnblogs.com/7cms-3xll/archive/2013/01/17/2864140.html

你可能感兴趣的文章
NOIP 2000 乘积最大
查看>>
fatal: the remote end hung up unexpectedly
查看>>
Delphi-操作剪贴板
查看>>
hdu 1029
查看>>
Docker 容器的网络连接 & 容器互联
查看>>
吾爱专题脱壳练习----压缩壳练习之三
查看>>
LeetCode -- Palindrome Linked List
查看>>
栈应用——逆波兰式表达式的值
查看>>
vscode 快速生成html
查看>>
div模拟textarea且高度自适应
查看>>
windows下vi/vim编辑器的基本操作
查看>>
负载均衡软件LVS分析二(安装)
查看>>
access INSERT INTO 语句的语法错误
查看>>
JQuery异步提交
查看>>
Python:将数组中的元素导出到变量中 (unpacking)
查看>>
ubuntu16.04安装mysql5.6
查看>>
mysql命令行中执行sql的几种方式总结
查看>>
ubantu 文件权限 Permission denied
查看>>
Python 多态 对象常用内置函数 运算符重载 对象迭代器 上下文管理
查看>>
Python 反射 元类 单例 冒泡
查看>>