absl::StrContains

StrContains overloads

Synopses

Declared in <absl/strings/match.h>

Returns whether a given string haystack contains the character needle.

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

Returns whether a given string haystack contains the substring needle.

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

Return Value

true if needle is found in haystack, false otherwise.

Parameters

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