1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:37:43 +00:00

AK: Add invert_case() and invert_case(StringView)

In the given String, invert_case() swaps lowercase characters with
uppercase ones and vice versa.
This commit is contained in:
huttongrabiel 2022-05-18 22:23:45 -07:00 committed by Linus Groh
parent b1709c368f
commit 8ffa860bc3
4 changed files with 21 additions and 0 deletions

View file

@ -388,6 +388,11 @@ String String::to_titlecase() const
return StringUtils::to_titlecase(*this);
}
String String::invert_case() const
{
return StringUtils::invert_case(*this);
}
bool operator<(char const* characters, String const& string)
{
return string.view() > characters;