absl::StartsWith

Returns whether a given string text begins with prefix.

Synopsis

Declared in <absl/strings/match.h>

constexpr
bool
StartsWith(
    std::string_view text,
    std::string_view prefix) noexcept;

Return Value

true if text begins with prefix, false otherwise.

Parameters

NameDescription
textThe string to test.
prefixThe prefix to look for.