summaryrefslogtreecommitdiff
path: root/AK/String.h
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-08-26 13:55:41 -0400
committerLinus Groh <mail@linusgroh.de>2021-08-26 22:04:09 +0100
commit262e4126346a650b442363887fe9683c56f71d1f (patch)
tree49d3bde5daa857fc0e6f76c6b7680a6d58055e4a /AK/String.h
parentd2af27d2d046111f3828914257e2f4dff065e365 (diff)
downloadserenity-262e4126346a650b442363887fe9683c56f71d1f.zip
AK: Implement method to convert a String/StringView to title case
This implementation preserves consecutive spaces in the orginal string.
Diffstat (limited to 'AK/String.h')
-rw-r--r--AK/String.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/AK/String.h b/AK/String.h
index e213ec3ebb..9bc3e5e2d1 100644
--- a/AK/String.h
+++ b/AK/String.h
@@ -120,6 +120,7 @@ public:
[[nodiscard]] String to_lowercase() const;
[[nodiscard]] String to_uppercase() const;
[[nodiscard]] String to_snakecase() const;
+ [[nodiscard]] String to_titlecase() const;
[[nodiscard]] bool is_whitespace() const { return StringUtils::is_whitespace(*this); }