[#absl-MaxSplits]
= xref:absl.adoc[absl]::MaxSplits
:relfileprefix: ../
:mrdocs:

A delimiter that limits the number of matches which can occur to the passed `limit`&period;

== Synopsis

Declared in `&lt;absl&sol;strings&sol;str&lowbar;split&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename Delimiter&gt;
&sol;&ast; implementation-defined &ast;&sol;
MaxSplits(
    Delimiter delimiter,
    int limit);
----

== Description

The last element in the returned collection will contain all remaining unsplit pieces, which may contain instances of the delimiter&period; The collection will contain at most `limit` &plus; 1 elements&period; Example&colon;

using absl&colon;&colon;MaxSplits&semi; std&colon;&colon;vector&lt;std&colon;&colon;string&gt; v &equals; absl&colon;&colon;StrSplit(&quot;a,b,c&quot;, MaxSplits(&apos;,&apos;, 1))&semi;

&sol;&sol; v&lsqb;0&rsqb;&equals;&equals; &quot;a&quot;, v&lsqb;1&rsqb;&equals;&equals; &quot;b,c&quot;

== Return Value

A delimiter wrapping `delimiter` with the given match limit&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *delimiter*
| The underlying delimiter whose matches are limited&period;
| *limit*
| The maximum number of matches allowed&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
