Template Function cif::split

Function Documentation

template<typename StringType = std::string_view>
std::vector<StringType> cif::split(std::string_view s, std::string_view separators, bool suppress_empty = false)

Split the string in s based on the characters in separators.

Each of the characters in separators induces a split.

When suppress_empty is true, empty strings are not produced in the resulting array.

Example:

auto v = cif::split("aap:noot,,mies", ":,", true);

assert(v == std::vector{"aap", "noot", "mies"});