GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - yumetodo/string_split: STLのstringをchain method風味にsplitする

BranchesTags
Open more actions menu

Latest commit

 

History

174 Commits
174 Commits

Folders and files

NameName
Last commit message
Last commit date
benchmark
benchmark
 
 
cmake/modules
cmake/modules
 
 
include
include
 
 
iutest @ 37deb72
iutest @ 37deb72
 
 
sample
sample
 
 
test
test
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
.travis.yml
.travis.yml
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
shippable.yml
shippable.yml
 
 

Repository files navigation

string split like chain method

Run Status Build Status Coverage Status Boost Software License

This is a C++ header only library to split string.

Usage

Just include include/string_split.hpp.

#include "../include/string_split.hpp"
#include <iostream>
int main()
{
    std::string s = "arikitari na world!";
    const auto s_1 = s | split(' ')[1];//"na"
    std::string s2 = "123,421,113";
    const auto s_2 = s2 | split(',') >> [](const std::string& s) {
        return std::stoi(s);
    };//[123,421,113]
    s2 | split(',') >> [](std::string&& s) {
        std::cout << s << std::endl;
    };
    /*stdout:
    123
    421
    113
    */
    return 0;
}

Temporary std::vector<std::string> will not be created becase the priority of operator[]/operator>> is higher than operator|

Compiler requirement

C++11 support is required(need C++14 support is required to compile testcase).

However, we support Visual Studio 2015 update2 or later.

std::string_view

We are supporting std::basic_string_view.

Enable C++17 mode and use below:

  • Visual Studio 2017
  • GCC 7.1 or later
  • clang 4 or later

About

STLのstringをchain method風味にsplitする

Topics

chaincppcpp-librarystringstring-split

Resources

Readme
BSL-1.0 license
Activity

Stars

5 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.