mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-09 19:16:02 +00:00
AK: Add String::replace() functionality
This adds a replace functionality that replaces a string that contains occurences of a "needle" by a "replacement" value. With "all_occurences" enabled, all occurences are being replaced, otherwise only the first occurence is being replaced.
This commit is contained in:
parent
9d5d0261e1
commit
2577712a1c
Notes:
sideshowbarker
2024-07-19 08:00:38 +09:00
Author: https://github.com/lnzero1dev
Commit: 2577712a1c
Pull-request: https://github.com/SerenityOS/serenity/pull/1569
3 changed files with 62 additions and 0 deletions
|
@ -214,6 +214,8 @@ public:
|
|||
|
||||
StringView view() const;
|
||||
|
||||
int replace(const String& needle, const String& replacement, bool all_occurences = false);
|
||||
|
||||
private:
|
||||
RefPtr<StringImpl> m_impl;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue