[#absl-StrSplit-07] = xref:absl.adoc[absl]::StrSplit :relfileprefix: ../ :mrdocs: `StrSplit` overloads == Synopses Declared in `<absl/strings/str_split.h>` Splits a string into a sequence of substrings identified by `Delimiter`. The input is processed sequentially from beginning to end, and each resulting substring is filtered by an optional `Predicate` before inclusion in the result set. `StrSplit()` returns a lazy range that preserves the substrings original order and is convertible to the collection type specified by the caller. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<typename Delimiter> /* implementation-defined */::Splitter</* implementation-defined */::type, AllowEmpty, std::string_view> xref:absl/StrSplit-011.adoc[StrSplit]( /* implementation-defined */::ConvertibleToStringView text, Delimiter d); ---- [.small]#xref:absl/StrSplit-011.adoc[_» more..._]# Overload of `StrSplit()` that takes ownership of a `std::string` input. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Delimiter, typename StringType, xref:absl/EnableSplitIfString.adoc[EnableSplitIfString<StringType>] = 0> /* implementation-defined */::Splitter</* implementation-defined */::type, AllowEmpty, std::string> xref:absl/StrSplit-02.adoc[StrSplit]( StringType&& text, Delimiter d); ---- [.small]#xref:absl/StrSplit-02.adoc[_» more..._]# Overload of `StrSplit()` that filters substrings with a `Predicate`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Delimiter, typename Predicate> /* implementation-defined */::Splitter</* implementation-defined */::type, Predicate, std::string_view> xref:absl/StrSplit-0d.adoc[StrSplit]( /* implementation-defined */::ConvertibleToStringView text, Delimiter d, Predicate p); ---- [.small]#xref:absl/StrSplit-0d.adoc[_» more..._]# Overload of `StrSplit()` that takes ownership of a `std::string` input and filters substrings with a `Predicate`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< typename Delimiter, typename Predicate, typename StringType, xref:absl/EnableSplitIfString.adoc[EnableSplitIfString<StringType>] = 0> /* implementation-defined */::Splitter</* implementation-defined */::type, Predicate, std::string> xref:absl/StrSplit-01c.adoc[StrSplit]( StringType&& text, Delimiter d, Predicate p); ---- [.small]#xref:absl/StrSplit-01c.adoc[_» more..._]# == Return Value * A lazy range of substrings convertible to the caller's collection. * A lazy range of the retained substrings. == Parameters [cols="1,4"] |=== | Name| Description | *text* | The string to split. | *d* | The delimiter identifying the split points. | *p* | The predicate that decides whether a substring is included. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#