diff options
author | Timothy Flynn <trflynn89@pm.me> | 2023-01-14 10:17:32 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-01-15 01:00:20 +0000 |
commit | cf0899f44094e4481a1ac207af9e94239647fb81 (patch) | |
tree | ef0cdfcb7ed17a72602164eaf17860ebe5af197b /AK/String.h | |
parent | bd9b65e82f03ec2bd2d96180c3352e9966be49bc (diff) | |
download | serenity-cf0899f44094e4481a1ac207af9e94239647fb81.zip |
AK: Add String::contains
Diffstat (limited to 'AK/String.h')
-rw-r--r-- | AK/String.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/AK/String.h b/AK/String.h index 54b3996e31..ce4de09bde 100644 --- a/AK/String.h +++ b/AK/String.h @@ -12,6 +12,7 @@ #include <AK/Optional.h> #include <AK/RefCounted.h> #include <AK/Span.h> +#include <AK/StringUtils.h> #include <AK/StringView.h> #include <AK/Traits.h> #include <AK/Types.h> @@ -92,6 +93,9 @@ public: return (this->operator==(forward<Ts>(strings)) || ...); } + [[nodiscard]] bool contains(StringView, CaseSensitivity = CaseSensitivity::CaseSensitive) const; + [[nodiscard]] bool contains(char, CaseSensitivity = CaseSensitivity::CaseSensitive) const; + [[nodiscard]] u32 hash() const; template<Arithmetic T> |