mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +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
12 changed files with 44 additions and 52 deletions
|
@ -62,6 +62,11 @@ Optional<size_t> find(StringView const& haystack, char needle, size_t start = 0)
|
|||
Optional<size_t> find(StringView const& haystack, StringView const& needle, size_t start = 0);
|
||||
Optional<size_t> find_last(StringView const& haystack, char needle);
|
||||
Vector<size_t> find_all(StringView const& haystack, StringView const& needle);
|
||||
enum class SearchDirection {
|
||||
Forward,
|
||||
Backward
|
||||
};
|
||||
Optional<size_t> find_any_of(StringView const& haystack, StringView const& needles, SearchDirection);
|
||||
|
||||
String to_snakecase(const StringView&);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue