Boost::split用法详解
工程中使用boost库:(设定vs2010环境)
在Library files加上 D:\boost\boost_1_46_0\bin\vc10\lib
在Include files加上 D:\boost\boost_1_46_0
// boostTest.cpp : 定义控制台应用程序的入口点。
#include "stdafx.h" #include <iostream>
#include <boost/format.hpp>
#include <boost/tokenizer.hpp>
#include <boost/algorithm/string.hpp> int _tmain(int argc, _TCHAR* argv[])
{
std::wcout.imbue(std::locale("chs"));
//待分割的字符串
std::wstring strTag = _T("I Come from China"); std::vector<std::wstring> vecSegTag;
// boost::is_any_of这里相当于分割规则了
boost::split(vecSegTag, strTag,boost::is_any_of(_T(" ,,"))); for (size_t i =;i<vecSegTag.size();i++)
{
std::wcout<<vecSegTag[i]<<std::endl;
} vecSegTag.clear();
std::wstring strTag2 = _T("我叫小马,你呢,今天天气不错,我很高兴");
boost::split(vecSegTag, strTag2, boost::is_any_of(_T(" ,,"))); for (size_t i = ; i<vecSegTag.size(); i++)
{
std::wcout<<vecSegTag[i]<<std::endl;
} getchar();
return ;
}
Boost::split用法详解的更多相关文章
- [转] boost::function用法详解
http://blog.csdn.net/benny5609/article/details/2324474 要开始使用 Boost.Function, 就要包含头文件 "boost/fun ...
- boost::function用法详解
要开始使用 Boost.Function, 就要包含头文件 "boost/function.hpp", 或者某个带数字的版本,从 "boost/function/func ...
- boost::algorithm用法详解之字符串关系判断
http://blog.csdn.net/qingzai_/article/details/44417937 下面先列举几个常用的: #define i_end_with boost::iends_w ...
- boost::fucntion 用法详解
转载自:http://blog.csdn.net/benny5609/article/details/2324474 要开始使用 Boost.Function, 就要包含头文件 "boost ...
- C#的String.Split 分割字符串用法详解的代码
代码期间,把代码过程经常用的内容做个珍藏,下边代码是关于C#的String.Split 分割字符串用法详解的代码,应该对码农们有些用途. 1) public string[] Split(params ...
- SQL中CONVERT()函数用法详解
SQL中CONVERT函数格式: CONVERT(data_type,expression[,style]) 参数说明: expression 是任何有效的 Microsoft® SQL Server ...
- Delphi TStringHelper用法详解
Delphi TStringHelper用法详解 (2013-08-27 22:45:42) 转载▼ 标签: delphi_xe5 it 分类: Delphi Delphi XE4的TStringHe ...
- Delphi XE4 TStringHelper用法详解
原文地址:Delphi XE4 TStringHelper用法详解作者:天下为公 Delphi XE4的TStringHelper,对操作字符串进一步带来更多的方法,估计XE5还能继续用到. Syst ...
- Vue1.0用法详解
Vue.js 不支持 IE8 及其以下版本,因为 Vue.js 使用了 IE8 不能实现的 ECMAScript 5 特性. 开发环境部署 可参考使用 vue+webpack. 基本用法 1 2 3 ...
随机推荐
- emacs之开始就加载tag
~/emacsConfig/original-tags.el (setq tags-table-list ' ( "~/emacsConfig/etags/muduo" " ...
- windows平台最简单的rtmp/hls流媒体服务器
feature: rtmp/hls live server for windows, double click to run,don't need config. run and quit: doub ...
- mysql索引之四:复合索引之最左前缀原理,索引选择性,索引优化策略之前缀索引
高效使用索引的首要条件是知道什么样的查询会使用到索引,这个问题和B+Tree中的“最左前缀原理”有关,下面通过例子说明最左前缀原理. 一.最左前缀索引 这里先说一下联合索引的概念.MySQL中的索引可 ...
- Win10怎么以管理员身份运行CMD命令提示符
[方法一] 我们可以在Windows10系统的开始菜单上,单击鼠标右键,这时候出现的菜单中,我们选择命令提示符(管理员)点击打开这样即可. 2 这样打开以后,大家可以看到命令提示符界面中显示管理员:命 ...
- hadoop Partiton中的字符串Hash函数改进
最近的MapReduce端的Partition根据map生成的Key来进行哈希,导致哈希出来的Reduce端处理任务数量非常不均匀,有些Reduce端处理的数据量非常小(几分钟就执行完成,而最后的pa ...
- 十七 能停止的线程 暴力停止 和 interrupt/return方法
1:stop: 使用stop() 停止的线程则是非常暴力的. stop() 已经废弃了,因为: 1 如果强制停止则有可能使得一些清理工作得不到完成. 2 对锁定的对象进行了“解锁”,导致数据得不到同步 ...
- 5月17日上课笔记-js面向对象
二.js面向对象 js创建对象: var 对象名称 = new Object(); person.name = "小明"; //姓名 person.age = 18; person ...
- 【BZOJ】1001: [BeiJing2006]狼抓兔子(最小割 / 对偶图)
题目 传送门:QWQ 分析 显然答案是最小割. 然后dinic卡一卡过去了. 其实是懒得写转对偶图:正解 (dinic原来写的是vector,后来改的比较鬼畜 代码 #include <bits ...
- 【学习笔记】dp入门
知识点 动态规划(简称dp),可以说是各种程序设计中遇到的第一个坎吧,这篇博文是我对dp的一点点理解,希望可以帮助更多人dp入门. 先看看这段话 动态规划(dynamic programming) ...
- Nginx加状态监控
安装Nginx时加上 –with-http_stub_status_module 在nginx.conf server location /nginx_status { stub_sta ...