AK: Add String{,Utils}::to_snakecase()

This is an improved version of WrapperGenerator's snake_name(), which
seems like the kind of thing that could be useful elsewhere but would
end up getting duplicated - so let's add this to AK::String instead,
like to_{lowercase,uppercase}().
This commit is contained in:
Linus Groh 2021-02-20 22:39:22 +01:00 committed by Andreas Kling
commit 4fafe14691
Notes: sideshowbarker 2024-07-18 22:02:22 +09:00
5 changed files with 50 additions and 0 deletions

View file

@ -389,6 +389,11 @@ String String::to_uppercase() const
return m_impl->to_uppercase();
}
String String::to_snakecase() const
{
return StringUtils::to_snakecase(*this);
}
bool operator<(const char* characters, const String& string)
{
if (!characters)