mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
AK+LibUnicode: Provide Unicode-aware String titlecase transformation
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user