c++ - 具有多个空格的增强拆分功能
问题描述
我正在使用 boost 来拆分字符串
boost::split(vectorStrSplitData, stdstrTxt, boost::is_any_of(" "), boost::token_compress_off);
当我使用这个字符串时,我在数字后添加多个空格时,我希望包含拆分字符串的向量的大小增加。
std::string str = "Number ";
第一个向量元素是我所期望的,但没有空格。预期输出为:
{"Number", " ", " ", " " , " "}
我试图查询空间,但没有得到任何结果。
if (isspace(chr))
std::cout << "Is Space";
解决方案
推荐阅读
- r - 将名称和时间数据从(每个时间内的名称)重塑为(每个名称的所有时间)
- java - 使用非静态方法作为泛型的枚举属性
- javascript - 如何正确使用 setInterval 和 clearInterval
- ubuntu - 在 Ubuntu 上安装 Boost 二进制文件
- sql - 基于另一行插入行
- kotlin - 获取价格应用内计费库
- php - Laravel 5.5 无法解析的依赖解析
- jquery - jquery LOAD 和 bootstrap 4 问题
- scala - 有没有办法告诉 scala 编译器在编译匿名 scala 函数时生成私有方法?
- amazon-web-services - Ansible 和 AWS 子网