boost——string_alog字符串的操作(五)
2013-06-13 10:29
218 查看
#include <boost/algorithm/string.hpp> #include <boost/typeof/typeof.hpp> using namespace boost; using namespace std; int _tmain(int argc, _TCHAR* argv[]) { string str = "Samus, Link.Zelda::Mario-Luigi+zelda" ; deque<string> d ; ifind_all(d, str, "zELDA") ; assert(d.size() == 2) ; for (BOOST_AUTO(pos, d.begin()); pos != d.end(); ++pos) { cout << "["<< *pos << "]" ; } cout << endl ; list< iterator_range<string::iterator> > l ; split(l, str, is_any_of(",.:+-")) ; for(BOOST_AUTO(pos, l.begin()); pos != l.end(); ++pos) { cout << "["<< *pos << "]" ; } cout << endl ; l.clear() ; split(l, str, is_any_of(".:-"), token_compress_on) ; for(BOOST_AUTO(pos, l.begin()); pos != l.end(); ++pos) { cout << "["<< *pos << "]" ; } cout << endl ; }
相关文章推荐
- boost——string_alog字符串的操作(四)
- boost——string_algo字符串的操作(三)
- boost——string_algo字符串的操作(一)
- C#入门篇6-3:字符串操作 string的ToString() Split()和Copy()方法
- C++ 字符(char)与字符串(string)操作
- Python字符串操作和string模块代码分析
- 字符串操作 string常用的函数
- PHP学习笔记--字符串操作 作者:yezi33 字符串的整理: trim():除去字符串开头和末尾的空格或其他字符。函数执行成功时返回删除了string字符串首部和尾部空格的字符串,发生错误时返回空
- 2381.字符串的操作。string(长度,‘所需输出的内容’)
- js String对象中常用方法小结(字符串操作)
- Python 字符串操作(string替换、删除、截取、复制、连接、比较、查找、包含、大小写转换、分割等)
- Swift学习笔记(十六)——String字符串的基础操作
- 黄聪:Python 字符串操作(string替换、删除、截取、复制、连接、比较、查找、包含、大小写转换、分割等)
- 重写string.h中的字符串操作函数--strchr
- Java String 字符串操作小结
- PHP中有关于String字符串的操作
- Python 字符串操作(string替换、删除、截取、复制、连接、比较、查找、包含、大小写转换、分割等)
- 13字符串---String 操作
- 记录-关于String的字符串操作
- boost——字符串与文本处理string_algo(二)