Always returns true, indicating that all strings--including empty strings--should be included in the split output.
Declared in <absl/strings/str_split.h>
struct AllowEmpty;
This predicate is not strictly needed because this is the default behavior of StrSplit(); however, it might be useful at some call sites to make the intent explicit.
Example:
std::vector<std::string> v = absl::StrSplit(" a , ,,b,", ',', AllowEmpty());
// v[0]== " a ", v[1]== " ", v[2]== "", v[3]= "b", v[4]== ""
| Name | Description |
|---|---|
operator() | Returns true for any substring, including empty ones. |