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 ...
随机推荐
- error: device not found
C:\Users\Administrator>adb shell error: device not found 出现上面情况,首先检查设备管理器中,安卓的驱动是否安装OK? 如果驱动 ...
- xml获取属性值的方法
sSqlstr += string.Format(@" and businessattr.value('(/Arch/Field[@Name=""发文单位$$" ...
- 关于Markdown的空行
如何在Markdown中输入一个空行? 最简单的做法是加一个<br>(html)或者<br />(xhtml),因为Markdown完全兼容html语法,但有的编辑器会支持,譬 ...
- snmp安装zabbix
zabbix能监视各种网络参数,保证服务器系统的安全运营:并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种问题. zabbix由2部分构成,zabbix server与可选组件zabbix ...
- [转载]嵌入式linux启动时运行的inittab文件
源地址:https://www.cnblogs.com/yfz0/p/5853826.html 嵌入式系统下的linux启动配置文件,不同与普通的PC linux启动配置,启动相关文件与文件的内容也要 ...
- log4j示例-Daily方式(log4j.properties)
log_home=./log log4j.rootLogger=info log4j.category.com.ai.toptea.collection=Console,DailyFile,Daily ...
- 020:Buffer Pool 、压缩页、CheckPoint、Double Write、Change Buffer
一. 缓冲池(Buffer Pool) 1.1 缓冲池介绍 每次读写数据都是通过 Buffer Pool : 当Buffer Pool 中没有用户所需要的数据时,才去硬盘中获取: 通过 innodb_ ...
- canvas之画一条线段
var canvas=document.getElementById("canvas"); //设置绘图环境 var cxt=canvas.getContext('2d'); // ...
- jdk ssl证书
- CC1,IceBreak,Hello world ,hello toastmaster
this is my first speech:icebreak in toastmaster,it is precious memory for me,this is first time that ...