Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to tokenize a string in c++

auto const str = "The quick brown fox"s;
auto const re = std::regex{R"(s+)"};
auto const vec = std::vector<std::string>(
    std::sregex_token_iterator{begin(str), end(str), re, -1},
    std::sregex_token_iterator{}
);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #tokenize #string
ADD COMMENT
Topic
Name
1+5 =