#upper-case #string #casing #case #capital

ucfirst

Uppercase the first letter of a string

3 unstable releases

0.2.1 Jan 7, 2024
0.2.0 Jan 7, 2024
0.1.0 May 11, 2023

#996 in Text processing

Download history 1/week @ 2023-12-18 7/week @ 2023-12-25 1/week @ 2024-02-19 50/week @ 2024-02-26 5/week @ 2024-03-04 20/week @ 2024-03-11 12/week @ 2024-03-18 3/week @ 2024-03-25 83/week @ 2024-04-01

119 downloads per month
Used in xpg

MIT license

3KB

This is the long-awaited Rust crate that solves the problem of uppercasing the first letter of a string in Rust.

Full disclosure: this solution was shamelessly lifted from the leading response over on StackOverflow by Shepmaster.

use ucfirst::ucfirst;

assert_eq!(ucfirst("apple"), "Apple");

See also the ccase CLI utility and convert_case library crates.

No runtime deps