1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:47:45 +00:00

AK: Give DeprecatedString::replace() a default mode

This is used in Jakt, and providing that value from Jakt's side is more
trouble than doing this.
Considering this class is bound to go away, a little
backwards-compatible API change is just fine.
This commit is contained in:
Ali Mohammad Pur 2022-12-09 20:05:43 +03:30 committed by Ali Mohammad Pur
parent 7a17fd6d71
commit 099a6bc45f

View file

@ -299,7 +299,7 @@ public:
return { characters(), length() };
}
[[nodiscard]] DeprecatedString replace(StringView needle, StringView replacement, ReplaceMode replace_mode) const { return StringUtils::replace(*this, needle, replacement, replace_mode); }
[[nodiscard]] DeprecatedString replace(StringView needle, StringView replacement, ReplaceMode replace_mode = ReplaceMode::All) const { return StringUtils::replace(*this, needle, replacement, replace_mode); }
[[nodiscard]] size_t count(StringView needle) const { return StringUtils::count(*this, needle); }
[[nodiscard]] DeprecatedString reverse() const;