summaryrefslogtreecommitdiff
path: root/AK/StringView.h
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2021-01-12 23:28:45 +0330
committerAndreas Kling <kling@serenityos.org>2021-01-12 23:36:20 +0100
commit39442e6d4f0ace5ccae377a320e4a922908cd0c8 (patch)
treeb55c315240e18687d4202eb61ae2618f0c7a74e0 /AK/StringView.h
parent4fa843531062032244070beb68f9694b2b481a6a (diff)
downloadserenity-39442e6d4f0ace5ccae377a320e4a922908cd0c8.zip
AK: Add String{View,}::find(StringView)
I personally mistook `find_first_of(StringView)` to be analogous to this so let's add a `find()` method that actually searches the string.
Diffstat (limited to 'AK/StringView.h')
-rw-r--r--AK/StringView.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/AK/StringView.h b/AK/StringView.h
index e83af7642c..7ff37437c3 100644
--- a/AK/StringView.h
+++ b/AK/StringView.h
@@ -100,6 +100,9 @@ public:
Optional<size_t> find_last_of(char) const;
Optional<size_t> find_last_of(const StringView&) const;
+ Optional<size_t> find(const StringView&) const;
+ Optional<size_t> find(char c) const;
+
StringView substring_view(size_t start, size_t length) const;
StringView substring_view(size_t start) const;
Vector<StringView> split_view(char, bool keep_empty = false) const;