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:
parent
bc51017a03
commit
d6ddca0c0f
3 changed files with 33 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue