1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:37:35 +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:
Shannon Booth 2020-02-15 10:14:22 +13:00 committed by Andreas Kling
parent a406a8c7d2
commit 854f0b9e1a
3 changed files with 20 additions and 0 deletions

View file

@ -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;