1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:17:35 +00:00

AK: Add String starts_with(char) & 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 13:04:00 +13:00 committed by Andreas Kling
parent 0e3a9d8e9d
commit 9920d17342
3 changed files with 19 additions and 0 deletions

View file

@ -157,6 +157,8 @@ public:
bool starts_with(const StringView&) const;
bool ends_with(const StringView&) const;
bool starts_with(char) const;
bool ends_with(char) const;
bool operator==(const String&) const;
bool operator!=(const String& other) const { return !(*this == other); }