boost split字符串
boost split string , which is very convenience
#include <string>
#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 =0;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 =0;i<vecSegTag.size();i++)
{
std::wcout<<vecSegTag[i]<<std::endl;
}
getchar();
return 0;
}
boost split字符串的更多相关文章
- boost::algorithm(字符串算法库)
没什么说的,需要 #include<boost/algorithm/string.hpp> 1.大小写转换 std::string s("test string"); ...
- Boost::split用法详解
工程中使用boost库:(设定vs2010环境)在Library files加上 D:\boost\boost_1_46_0\bin\vc10\lib在Include files加上 D:\boost ...
- Split字符串分割函数
非常非常常用的一个函数Split字符串分割函数. Dim myTest myTest = "aaa/bbb/ccc/ddd/eee/fff/ggg" Dim arrTest arr ...
- freemarker中的split字符串分割
freemarker中的split字符串分割 1.简易说明 split分割:用来根据另外一个字符串的出现将原字符串分割成字符串序列 2.举例说明 <#--freemarker中的split字符串 ...
- freemarker中的split字符串分割(十六)
1.简易说明 split分割:用来根据另外一个字符串的出现将原字符串分割成字符串序列 2.举例说明 <#--freemarker中的split字符串分割--> <#list &quo ...
- C++开发--在Visual Studio2013中使用boost::split()编译过程中出现error C4996
Visual Studio is being overly cautious. In debug mode, visual studio uses something called "Ch ...
- freemarker中间split字符串切割
freemarker中间split字符串切割 1.简易说明 split切割:用来依据另外一个字符串的出现将原字符串切割成字符串序列 2.举例说明 <#--freemarker中的split字符串 ...
- c++分割字符串(类似于boost::split)
由于c++字符串没有split函数,所以字符串分割单词的时候必须自己手写,也相当于自己实现一个split函数吧! 如果需要根据单一字符分割单词,直接用getline读取就好了,很简单 #include ...
- hive函数 -- split 字符串分割函数
hive字符串分割函数 split(str, regex) - Splits str around occurances that match regexTime taken: 0.769 secon ...
随机推荐
- vCenter Server 6.7 集成 vRealize Orchestrator 7.5
第一步,安装独立Orchestrator 7.5,并初始化 Orchestrator ova导入和初始化步骤省略...请参考官方文档... Orchestrator 初始化中的认证源需要和vCen ...
- 源码安装GCC-4.9.2
本文参考:http://cuchadanfan.blog.51cto.com/9940284/1689556 感谢原作者的分享! 首先安装基础包,安装网络依赖的时候要用 [root@localhos ...
- centos 7 删除 virbr0 虚拟网卡virsh net-list
这几天研究dubbo,在电脑上装了几台Center os 7虚拟机,最后把提供者部署到虚拟机中时,发现一个有趣的事:在dubbo-admin管理平台上看到两台不同虚拟机中的服务提供者ip都是这个玩意. ...
- hibernate关联非主键注解配置
现在有两张表:一张t_s_user用户表和t_s_user_serial_number用户序号表 CREATE TABLE `t_s_user` ( `id` ) NOT NULL, `email` ...
- java 普通内部类和静态内部类
区别1: 普通内部类实例化后的对象持有外部类的引用,在非静态类内部可以访问外部类的成员:静态内部类实例化不持有外部对象引用,不能访问外面的方法和成员: 从耦合度上来讲,普通内部类跟外部类耦合程度很高, ...
- 【cs231n】反向传播笔记
前言 首先声明,以下内容绝大部分转自知乎智能单元,他们将官方学习笔记进行了很专业的翻译,在此我会直接copy他们翻译的笔记,有些地方会用红字写自己的笔记,本文只是作为自己的学习笔记.本文内容官网链接: ...
- 51Nod 1433 0和5(9的倍数理论)
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1433 思路: 数论中关于9的倍数的理论:若是一个数能被9整除,则各位数之 ...
- AngularJS 教程 - CodePreject
http://www.codeproject.com/Articles/1065838/AngularJS-Tutorial Article Series Tutorial 1: Angular JS ...
- server2012/win8 卸载.net framework 4.5后 无法进入系统桌面故障解决
故障:服务器装的是windows2012 standard(2012版本从低到高依次为Foundation.Essentials.StandardDatacenter,以及它们的升级版R2),由于要安 ...
- linux下查看进程路径
在linux下查看进程大家都会想到用 ps -ef|grep XXX可是看到的不是全路径,怎么看全路径呢?每个进程启动之后在 /proc下面有一个于pid对应的路径例如:ps -ef|grep pyt ...