absl::StrSplit

Overload of StrSplit() that filters substrings with a Predicate.

Synopsis

Declared in <absl/strings/str_split.h>

template<
    typename Delimiter,
    typename Predicate>
/* implementation-defined */::Splitter</* implementation-defined */::type, Predicate, std::string_view>
StrSplit(
    /* implementation-defined */::ConvertibleToStringView text,
    Delimiter d,
    Predicate p);

Return Value

A lazy range of the retained substrings.

Parameters

NameDescription
textThe string to split.
dThe delimiter identifying the split points.
pThe predicate that decides whether a substring is included.