mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
AK: Implement String::find_any_of() and StringView::find_any_of()
This implements StringUtils::find_any_of() and uses it in String::find_any_of() and StringView::find_any_of(). All uses of find_{first,last}_of have been replaced with find_any_of(), find() or find_last(). find_{first,last}_of have subsequently been removed.
This commit is contained in:
parent
17eddf3ac4
commit
9cc35d1ba3
Notes:
sideshowbarker
2024-07-18 11:06:02 +09:00
Author: https://github.com/MaxWipfli
Commit: 9cc35d1ba3
Pull-request: https://github.com/SerenityOS/serenity/pull/8368
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/trflynn89
12 changed files with 44 additions and 52 deletions
|
@ -147,6 +147,8 @@ public:
|
|||
[[nodiscard]] Optional<size_t> find_last(char needle) const { return StringUtils::find_last(*this, needle); }
|
||||
// FIXME: Implement find_last(StringView const&) for API symmetry.
|
||||
[[nodiscard]] Vector<size_t> find_all(StringView const& needle) const { return StringUtils::find_all(*this, needle); }
|
||||
using SearchDirection = StringUtils::SearchDirection;
|
||||
[[nodiscard]] Optional<size_t> find_any_of(StringView const& needles, SearchDirection direction) const { return StringUtils::find_any_of(*this, needles, direction); }
|
||||
|
||||
[[nodiscard]] String substring(size_t start, size_t length) const;
|
||||
[[nodiscard]] String substring(size_t start) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue