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

A single character delimiter&period;

== Synopsis

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

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

== Description

`ByChar` is functionally equivalent to a 1&hyphen;char string within a `ByString` delimiter, but slightly more efficient&period;

Example&colon;

&sol;&sol; Because a char literal is converted to a absl&colon;&colon;ByChar, &sol;&sol; the following two splits are equivalent&period; std&colon;&colon;vector&lt;std&colon;&colon;string&gt; v1 &equals; absl&colon;&colon;StrSplit(&quot;a,b,c&quot;, &apos;,&apos;)&semi; using absl&colon;&colon;ByChar&semi; std&colon;&colon;vector&lt;std&colon;&colon;string&gt; v2 &equals; absl&colon;&colon;StrSplit(&quot;a,b,c&quot;, ByChar(&apos;,&apos;))&semi; &sol;&sol; v&lsqb;0&rsqb;&equals;&equals; &quot;a&quot;, v&lsqb;1&rsqb;&equals;&equals; &quot;b&quot;, v&lsqb;2&rsqb;&equals;&equals; &quot;c&quot;

`ByChar` is also the default delimiter if a single character is given as the delimiter to `StrSplit()`&period; For example, the following calls are equivalent&colon;

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

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

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:absl/ByChar/2constructor.adoc[`ByChar`]         [.small]#[constructor]#
| Constructs a `ByChar` delimiter matching the character `c`&period;
| xref:absl/ByChar/Find.adoc[`Find`] 
| Finds the next occurrence of the delimiter in `text` at or after `pos`&period;
|===



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