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 ...
随机推荐
- sphinx-1.3.0扩展在pPHP 7.0.7版本编译不通过
在这个网友也是在php7上面编译插件不通过 https://bugs.php.net/bug.php?id=71586 下php7对应的扩展文件即可 http://git.php.net/?p=pec ...
- debian下qt4动态编译
一句话不割,版本4.86 ./configure -prefix /home/用户名/Qt/dynamic -opensource -opengl -confirm-license -no-scrip ...
- 干净的 js测试页面
<!DOCTYPE html><html lang="en" > <head> <meta charset="utf-8&quo ...
- 【转】使用JMeter对数据库做压力测试
作为一名开发人员,大多情况下都会认真的做好功能测试,但是却常常忽略了软件开发之后的压力测试,尤其是在面向大量用户同时使用的Web应用系统的开发过程,压力测试往往是不够充分的.近期我在一个求职招聘型的网 ...
- java web 程序---在线时长
思路:toLocalString()这个方法 <body> <% long t=session.getLastAccessedTime(); long t2=session.getC ...
- canvas之抒写文字
<canvas id="canvas" width="500" height="400" style="background ...
- 自动化运维工具Ansible的简单使用
一 基础使用 1. 简介ansible是新出现的自动化运维工具,基于Python开发,集合了众多运维工具(puppet.cfengine.chef.func.fabric)的优点,实现了批量系统配置. ...
- Android:解决重复打开界面问题
点击界面A按钮,打开界面B,由于startActivity操作是异步执行的,假如在短时间内快速点击按钮,可能会导致打开多个B界面,这个时候可以重写Activity的startActivity事件. p ...
- 遇到的有关js继承和原型链的一个问题
function A(var1){ this.var1 = var1; } A.prototype = { var1:1 } var b=new A(); b.var1 = 2; var c = ne ...
- 数据库设计不推荐使用Bool类型
参见博文:http://blog.csdn.net/zhang_xinxiu/article/details/8521673