1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 08:15:07 +00:00

AK+LibUnicode: Provide Unicode-aware String titlecase transformation

This commit is contained in:
Timothy Flynn 2023-01-16 11:28:27 -05:00 committed by Tim Flynn
parent bc51017a03
commit d6ddca0c0f
3 changed files with 33 additions and 2 deletions

View file

@ -26,4 +26,11 @@ ErrorOr<String> String::to_uppercase(Optional<StringView> const& locale) const
return builder.to_string();
}
ErrorOr<String> String::to_titlecase(Optional<StringView> const& locale) const
{
StringBuilder builder;
TRY(Unicode::Detail::build_titlecase_string(code_points(), builder, locale));
return builder.to_string();
}
}