1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 21:07:36 +00:00

AK: Add a method to find the byte offset of a code point

This commit is contained in:
Timothy Flynn 2023-01-22 09:24:12 -05:00 committed by Tim Flynn
parent 5e44b93af2
commit d50724956e
3 changed files with 58 additions and 0 deletions

View file

@ -127,6 +127,8 @@ public:
ErrorOr<Vector<String>> split_limit(u32 separator, size_t limit, SplitBehavior = SplitBehavior::Nothing) const;
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;
[[nodiscard]] bool operator==(String const&) const;
[[nodiscard]] bool operator!=(String const& other) const { return !(*this == other); }