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

A delimiter for splitting into equal&hyphen;length strings&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class ByLength;
----

== Description

The length argument to the constructor must be greater than 0&period;

Note&colon; this delimiter works with single&hyphen;byte string data, but does not work with variable&hyphen;width encodings, such as UTF&hyphen;8&period;

Example&colon;

using absl&colon;&colon;ByLength&semi; std&colon;&colon;vector&lt;std&colon;&colon;string&gt; v &equals; absl&colon;&colon;StrSplit(&quot;123456789&quot;, ByLength(3))&semi; &sol;&sol; v&lsqb;0&rsqb;&equals;&equals; &quot;123&quot;, v&lsqb;1&rsqb;&equals;&equals; &quot;456&quot;, v&lsqb;2&rsqb;&equals;&equals; &quot;789&quot;

Note that the string does not have to be a multiple of the fixed split length&period; In such a case, the last substring will be shorter&period;

using absl&colon;&colon;ByLength&semi; std&colon;&colon;vector&lt;std&colon;&colon;string&gt; v &equals; absl&colon;&colon;StrSplit(&quot;12345&quot;, ByLength(2))&semi;

&sol;&sol; v&lsqb;0&rsqb;&equals;&equals; &quot;12&quot;, v&lsqb;1&rsqb;&equals;&equals; &quot;34&quot;, v&lsqb;2&rsqb;&equals;&equals; &quot;5&quot;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:absl/ByLength/2constructor.adoc[`ByLength`]         [.small]#[constructor]#
| Constructs a `ByLength` delimiter that splits every `length` characters&period;
| xref:absl/ByLength/Find.adoc[`Find`] 
| Finds the next split point in `text` at or after `pos`&period;
|===



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