Crate capitalize

Source
Expand description

§Capitalize

Crate version Unlicense Crates.io downloads GitHub Workflow Status

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§

Capitalize
It’s implemented for all types that implement AsRef<str>.