string封装一些小函数
来源:互联网 发布:2016中小企业数据统计 编辑:程序博客网 时间:2024/05/22 04:34
1、去掉字符串开头和结尾的空格
string trimWhiteSpaces(string strIn) { string strOut = strIn; if (!strOut.empty()) { while (strOut.size() > 0) { if (strOut[0] == ' ') { strOut = strOut.substr(1, strOut.size() -1); } else { break; } } while (strOut.size() > 0) { if (strOut[strOut.size() - 1] == ' ') { strOut = strOut.substr(0, strOut.size() -1); } else { break; } } } return strOut; }
0 0
- string封装一些小函数
- 封装kmalloc/malloc的一些小函数
- String的一些函数
- string 的一些函数
- 一些常用的函数封装
- py windows一些封装函数
- js的一些函数封装
- 一些小函数
- c# 一些小函数
- WordPress 一些小函数
- 回顾一些小函数
- 一些小函数
- 一些小函数集锦
- 一些实用小函数
- String一些函数的用法
- string一些常用函数基础
- 关于String的一些小知识
- String工作中的一些小应用
- Zurmo(十四)之ListView重写SecuredActionBar
- EOS7+中结合NUI实现流程图和活动信息的显示
- XFire创建WebService实例
- 代理的三种方法
- c/c++ No.16 求字符串长度
- string封装一些小函数
- lintcode(61)搜索区间
- cmd命令下进入mysql并查看数据库
- 递归的函数
- 在Linux中切换用户时变成-bash4.1-$
- js字符串反转
- DNA Sorting
- LeetCode 21 Merge Two Sorted Lists(合并链表)
- Hihocoder 1284 机会渺茫