A delimiter that limits the number of matches which can occur to the passed limit.
Declared in <absl/strings/str_split.h>
template<typename Delimiter>
/* implementation-defined */
MaxSplits(
Delimiter delimiter,
int limit);
The last element in the returned collection will contain all remaining unsplit pieces, which may contain instances of the delimiter. The collection will contain at most limit + 1 elements. Example:
using absl::MaxSplits; std::vector<std::string> v = absl::StrSplit("a,b,c", MaxSplits(',', 1));
// v[0]== "a", v[1]== "b,c"
A delimiter wrapping delimiter with the given match limit.
| Name | Description |
|---|---|
| delimiter | The underlying delimiter whose matches are limited. |
| limit | The maximum number of matches allowed. |