1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:17:36 +00:00

AK: Add a method to create a String with a repeated code point

This commit is contained in:
Timothy Flynn 2023-01-22 10:17:48 -05:00 committed by Tim Flynn
parent d50724956e
commit 427b82065c
3 changed files with 120 additions and 0 deletions

View file

@ -93,6 +93,9 @@ public:
return String { short_string };
}
// Creates a new String with a single code point repeated N times.
static ErrorOr<String> repeated(u32 code_point, size_t count);
// Creates a new String by case-transforming this String. Using these methods require linking LibUnicode into your application.
ErrorOr<String> to_lowercase(Optional<StringView> const& locale = {}) const;
ErrorOr<String> to_uppercase(Optional<StringView> const& locale = {}) const;