mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
AK: Implement StringBuilder::append_as_lowercase(char ch)
This patch adds a convenience method to AK::StringBuilder which converts ASCII uppercase characters to lowercase before appending them.
This commit is contained in:
committed by
Andreas Kling
parent
df29d58e19
commit
f51b0729f5
@@ -120,6 +120,14 @@ void StringBuilder::append(const Utf32View& utf32_view)
|
||||
}
|
||||
}
|
||||
|
||||
void StringBuilder::append_as_lowercase(char ch)
|
||||
{
|
||||
if (ch >= 'A' && ch <= 'Z')
|
||||
append(ch + 0x20);
|
||||
else
|
||||
append(ch);
|
||||
}
|
||||
|
||||
void StringBuilder::append_escaped_for_json(const StringView& string)
|
||||
{
|
||||
for (auto ch : string) {
|
||||
|
||||
Reference in New Issue
Block a user