[#absl-ByChar] = xref:absl.adoc[absl]::ByChar :relfileprefix: ../ :mrdocs: A single character delimiter. == Synopsis Declared in `<absl/strings/str_split.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class ByChar; ---- == Description `ByChar` is functionally equivalent to a 1‐char string within a `ByString` delimiter, but slightly more efficient. Example: // Because a char literal is converted to a absl::ByChar, // the following two splits are equivalent. std::vector<std::string> v1 = absl::StrSplit("a,b,c", ','); using absl::ByChar; std::vector<std::string> v2 = absl::StrSplit("a,b,c", ByChar(',')); // v[0]== "a", v[1]== "b", v[2]== "c" `ByChar` is also the default delimiter if a single character is given as the delimiter to `StrSplit()`. For example, the following calls are equivalent: std::vector<std::string> v = absl::StrSplit("a‐b", '‐'); using absl::ByChar; std::vector<std::string> v = absl::StrSplit("a‐b", ByChar('‐')); == Member Functions [cols="1,4"] |=== | Name| Description | xref:absl/ByChar/2constructor.adoc[`ByChar`] [.small]#[constructor]# | Constructs a `ByChar` delimiter matching the character `c`. | xref:absl/ByChar/Find.adoc[`Find`] | Finds the next occurrence of the delimiter in `text` at or after `pos`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#