mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibJS: Implement (mostly) spec compliant version of Number.toString()
This commit is contained in:
committed by
Andreas Kling
parent
be9c2feff0
commit
d3524f47a0
Notes:
sideshowbarker
2024-07-19 00:32:16 +09:00
Author: https://github.com/sunverwerth Commit: https://github.com/SerenityOS/serenity/commit/d3524f47a06 Pull-request: https://github.com/SerenityOS/serenity/pull/3803 Reviewed-by: https://github.com/linusg
@@ -364,6 +364,15 @@ int String::replace(const String& needle, const String& replacement, bool all_oc
|
||||
return positions.size();
|
||||
}
|
||||
|
||||
String String::reverse() const
|
||||
{
|
||||
StringBuilder reversed_string;
|
||||
for (size_t i = length(); i-- > 0;) {
|
||||
reversed_string.append(characters()[i]);
|
||||
}
|
||||
return reversed_string.to_string();
|
||||
}
|
||||
|
||||
String escape_html_entities(const StringView& html)
|
||||
{
|
||||
StringBuilder builder;
|
||||
|
||||
Reference in New Issue
Block a user