mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 10:19:20 +00:00
AK: Add StringView::starts_with(char) & StringView::ends_with(char)
This is simply meant to be a more efficient implementation in the case that we only need to check a single character.
This commit is contained in:
parent
a406a8c7d2
commit
854f0b9e1a
Notes:
sideshowbarker
2024-07-19 09:09:35 +09:00
Author: https://github.com/shannonbooth
Commit: 854f0b9e1a
Pull-request: https://github.com/SerenityOS/serenity/pull/1214
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bugaevc
Reviewed-by: https://github.com/willmcpherson2
3 changed files with 20 additions and 0 deletions
|
@ -63,6 +63,8 @@ public:
|
|||
|
||||
bool starts_with(const StringView&) const;
|
||||
bool ends_with(const StringView&) const;
|
||||
bool starts_with(char) const;
|
||||
bool ends_with(char) const;
|
||||
|
||||
StringView substring_view(size_t start, size_t length) const;
|
||||
Vector<StringView> split_view(char, bool keep_empty = false) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue