#case #change #string #title

capitalize

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

7 releases

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

#567 in Text processing

Download history 4/week @ 2024-01-03 25/week @ 2024-01-10 36/week @ 2024-01-17 23/week @ 2024-01-24 52/week @ 2024-01-31 14/week @ 2024-02-07 17/week @ 2024-02-14 34/week @ 2024-02-21 32/week @ 2024-02-28 54/week @ 2024-03-06 63/week @ 2024-03-13 76/week @ 2024-03-20 46/week @ 2024-03-27 42/week @ 2024-04-03 20/week @ 2024-04-10 574/week @ 2024-04-17

687 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