pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/yumetodo/string_split

ink crossorigen="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/primer-8522af645b000615.css" /> GitHub - yumetodo/string_split: STLのstringをchain method風味にsplitする · GitHub
Skip to content

yumetodo/string_split

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

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy