absl::ByString

A sub-string delimiter.

Synopsis

Declared in <absl/strings/str_split.h>

class ByString;

Description

If StrSplit() is passed a string in place of a Delimiter object, the string will be implicitly converted into a ByString delimiter.

Example:

// Because a string literal is converted to an absl::ByString, // the following two splits are equivalent.

std::vector<std::string> v1 = absl::StrSplit("a, b, c", ", ");

using absl::ByString; std::vector<std::string> v2 = absl::StrSplit("a, b, c", ByString(", ")); // v[0]== "a", v[1]== "b", v[2]== "c"

Member Functions

NameDescription
ByString [constructor]Constructs a ByString delimiter matching the sub-string sp.
Find Finds the next occurrence of the delimiter in text at or after pos.