absl::FindLongestCommonPrefix

Yields the longest prefix in common between both input strings. Pointer-wise, the returned result is a subset of input "a".

Synopsis

Declared in <absl/strings/match.h>

std::string_view
FindLongestCommonPrefix(
    std::string_view a,
    std::string_view b);

Return Value

The longest common prefix, as a view into a.

Parameters

NameDescription
aThe first string to compare.
bThe second string to compare.