1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:47:44 +00:00

AK: Implement method to convert a String/StringView to title case

This implementation preserves consecutive spaces in the orginal string.
This commit is contained in:
Timothy Flynn 2021-08-26 13:55:41 -04:00 committed by Linus Groh
parent d2af27d2d0
commit 262e412634
7 changed files with 43 additions and 0 deletions

View file

@ -85,6 +85,7 @@ public:
[[nodiscard]] String to_lowercase_string() const;
[[nodiscard]] String to_uppercase_string() const;
[[nodiscard]] String to_titlecase_string() const;
[[nodiscard]] Optional<size_t> find(char needle, size_t start = 0) const { return StringUtils::find(*this, needle, start); }
[[nodiscard]] Optional<size_t> find(StringView const& needle, size_t start = 0) const { return StringUtils::find(*this, needle, start); }