mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 19:15:07 +00:00
LibJS: Implement (mostly) spec compliant version of Number.toString()
This commit is contained in:
parent
be9c2feff0
commit
d3524f47a0
4 changed files with 151 additions and 20 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue