#upper-case #casing #capital #string

ucfirst

Uppercase the first letter of a string

5 unstable releases

0.3.0 Dec 5, 2024
0.2.2 Jul 26, 2024
0.2.1 Jan 7, 2024
0.2.0 Jan 7, 2024
0.1.0 May 11, 2023

#1693 in Text processing

Download history 11/week @ 2024-12-17 1/week @ 2024-12-31 9/week @ 2025-01-07 10/week @ 2025-01-14 15/week @ 2025-01-21 28/week @ 2025-01-28 78/week @ 2025-02-04 58/week @ 2025-02-11 90/week @ 2025-02-18 50/week @ 2025-02-25 94/week @ 2025-03-04 120/week @ 2025-03-11 63/week @ 2025-03-18 27/week @ 2025-03-25 73/week @ 2025-04-01

285 downloads per month
Used in xpg

MIT license

4KB

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