AK: Add String::find_last() and inline String::find() methods

This adds the String::find_last() as wrapper for StringUtils::find_last,
which is another step in harmonizing the String and StringView APIs
where possible.

This also inlines the find() methods, as they are simple wrappers around
StringUtils functions without any additional logic.
This commit is contained in:
Max Wipfli 2021-07-01 17:34:25 +02:00 committed by Andreas Kling
parent d7a104c27c
commit 268d81a56c
Notes: sideshowbarker 2024-07-18 11:06:10 +09:00
2 changed files with 4 additions and 12 deletions

View file

@ -459,14 +459,4 @@ String String::vformatted(StringView fmtstr, TypeErasedFormatParams params)
return builder.to_string();
}
Optional<size_t> String::find(char c, size_t start) const
{
return find(StringView { &c, 1 }, start);
}
Optional<size_t> String::find(StringView const& view, size_t start) const
{
return StringUtils::find(*this, view, start);
}
}