mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:07:34 +00:00
AK: Add a somewhat naive implementation of String::reverse
This will reverse the String's code points (i.e. not just its bytes), but is not aware of grapheme clusters.
This commit is contained in:
parent
f5d253dcfa
commit
9db9b2f9be
3 changed files with 38 additions and 0 deletions
|
@ -69,6 +69,7 @@ public:
|
|||
[[nodiscard]] StringView bytes_as_string_view() const;
|
||||
|
||||
ErrorOr<String> replace(StringView needle, StringView replacement, ReplaceMode replace_mode) const;
|
||||
ErrorOr<String> reverse() const;
|
||||
|
||||
[[nodiscard]] bool operator==(String const&) const;
|
||||
[[nodiscard]] bool operator!=(String const& other) const { return !(*this == other); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue