Function split_if
Synopsis
#include "breeze/text/split.hpp"
template <typename UnaryPredicate>
std::vector< std::string > split_if(std::string const &s, UnaryPredicate pred)
Description
- Returns
- A vector of strings obtained by splitting
s
at each character which satisfies the predicatepred
, in order.
pred
is called a separator in the following.
Consecutive separators, or separators as first or last character in s
, lead to an empty string in the resulting vector. The size of the vector is always one plus the number of separators in s
.
- Note
- This should probably use
set_of_chars
.
Source
Line 61 in breeze/text/split.hpp.