absl::StrContains

Returns whether a given string haystack contains the substring needle.

Synopsis

Declared in <absl/strings/match.h>

bool
StrContains(
    std::string_view haystack,
    std::string_view needle) noexcept;

Return Value

true if needle is found in haystack, false otherwise.

Parameters

NameDescription
haystackThe string to search within.
needleThe substring to search for.