absl::StrContains

Returns whether a given string haystack contains the character needle.

Synopsis

Declared in <absl/strings/match.h>

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

Return Value

true if needle is found in haystack, false otherwise.

Parameters

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