[#absl-ByLength] = xref:absl.adoc[absl]::ByLength :relfileprefix: ../ :mrdocs: A delimiter for splitting into equal‐length strings. == Synopsis Declared in `<absl/strings/str_split.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class ByLength; ---- == Description The length argument to the constructor must be greater than 0. Note: this delimiter works with single‐byte string data, but does not work with variable‐width encodings, such as UTF‐8. Example: using absl::ByLength; std::vector<std::string> v = absl::StrSplit("123456789", ByLength(3)); // v[0]== "123", v[1]== "456", v[2]== "789" Note that the string does not have to be a multiple of the fixed split length. In such a case, the last substring will be shorter. using absl::ByLength; std::vector<std::string> v = absl::StrSplit("12345", ByLength(2)); // v[0]== "12", v[1]== "34", v[2]== "5" == Member Functions [cols="1,4"] |=== | Name| Description | xref:absl/ByLength/2constructor.adoc[`ByLength`] [.small]#[constructor]# | Constructs a `ByLength` delimiter that splits every `length` characters. | xref:absl/ByLength/Find.adoc[`Find`] | Finds the next split point in `text` at or after `pos`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#