mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 09:04:30 +00:00
LibJS: Implement (mostly) spec compliant version of Number.toString()
This commit is contained in:
committed by
Andreas Kling
parent
be9c2feff0
commit
d3524f47a0
@@ -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