#string #title #change #case

capitalize

Change first character to upper case and the rest to lower case, and other common alternatives

7 releases

0.3.4 Apr 22, 2024
0.3.3 Apr 21, 2024
0.2.0 Apr 17, 2024
0.1.0 Mar 14, 2022

#218 in Text processing

Download history 296/week @ 2024-07-22 156/week @ 2024-07-29 147/week @ 2024-08-05 89/week @ 2024-08-12 581/week @ 2024-08-19 650/week @ 2024-08-26 531/week @ 2024-09-02 249/week @ 2024-09-09 250/week @ 2024-09-16 219/week @ 2024-09-23 236/week @ 2024-09-30 1071/week @ 2024-10-07 1601/week @ 2024-10-14 1627/week @ 2024-10-21 1256/week @ 2024-10-28 270/week @ 2024-11-04

4,767 downloads per month
Used in heraclitus-compiler

Unlicense

12KB
123 lines

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

No runtime deps