Crate capitalize
source ·Expand description
§Capitalize
First letter to uppercase, the rest to lowercase. And other common alternatives.
Extensively tested and optimized. Forbidden unsafe
in the whole crate.
§Examples
use capitalize::Capitalize;
assert_eq!("hello ✨ world".capitalize(), "Hello ✨ world");
Behavior is like Python’s str.capitalize
, read capitalize
reference for details.
§Extensively Tested
Languages tested:
- English
- Spanish
- German
- Turkish
- French
- Russian
- Ukrainian
- Greek
- Chinese
- Arabic
- Hebrew
- Korean
- Japanese
- Thai
- Hindi
- Bulgarian
- Serbian
- Macedonian
- Polish
- Czech
- Slovak
- Croatian
- Icelandic
- Armenian
- Albanian
- Mongolian
- Coptic
Traits§
- It’s implemented for all types that implement
AsRef<str>
.