1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:57:44 +00:00

AK: Add an overload of String::find_byte_offset for StringView

This commit is contained in:
Timothy Flynn 2023-01-27 10:17:34 -05:00 committed by Linus Groh
parent 38b4e938b7
commit c35b1371a3
3 changed files with 55 additions and 2 deletions

View file

@ -133,6 +133,7 @@ public:
ErrorOr<Vector<String>> split(u32 separator, SplitBehavior = SplitBehavior::Nothing) const;
Optional<size_t> find_byte_offset(u32 code_point, size_t from_byte_offset = 0) const;
Optional<size_t> find_byte_offset(StringView substring, size_t from_byte_offset = 0) const;
[[nodiscard]] bool operator==(String const&) const;
[[nodiscard]] bool operator!=(String const& other) const { return !(*this == other); }