Boost字符串分割split
来源:互联网 发布:条形码绑定数据库 编辑:程序博客网 时间:2024/04/29 15:29
boost中的split分割函数使用:
#include<iostream>#include<fstream>#include<vector>#include<string>#include<boost/algorithm/string/classification.hpp>#include<boost/algorithm/string/split.hpp>using namespace std;using namespace boost;int main(){ ifstream in("1125.txt",ios::in); string s; getline(in,s); cout<<s<<endl; vector<string> vec; split(vec,s,is_any_of("|")); for(vector<string>::iterator it=vec.begin();it!=vec.end();it++){ if(*it!="") cout<<*it<<endl; } return 0;}
假设1125.txt中内容为hello||world
则程序输出为:
hello||world
hello
world
- Boost字符串分割split
- boost使用split分割字符串
- boost 字符串分割 split, split_regex
- boost使用split分割字符串
- Boost学习笔记(六)---利用boost库string_algo::split函数分割字符串
- SPLIT分割字符串
- [转]Split 分割字符串
- split来分割字符串
- split()方法分割字符串
- split分割字符串
- split分割字符串
- sql 分割字符串split
- split正则分割字符串
- StringUtils 分割字符串 split
- StringUtils 分割字符串 split
- split字符串分割函数
- 字符串分割split()
- String.split() 字符串分割
- WPF中的StackPanel、WrapPanel、DockPanel
- js实现隔行变色操作鼠标经过效果
- js实现左侧无限级菜单
- 纯css下拉菜单
- java多线程技术(转发)
- Boost字符串分割split
- swfupload多文件上传(支持多Ctrl和Shift多选)
- java线程
- 查看 linux 设备号信息
- 单例模式(懒汉模式)中的线程同步问题
- c++学习连载-插入排序及其遇到的问题
- java线程(jdk5升级解决方案)
- Java语言基础组成
- 证书相关