capitalize

Function capitalize 

Source
pub fn capitalize(str_input: &str) -> String
Expand description

Capitalizes the first letter of the input string and converts the rest to lowercase.

§Arguments

  • str_input - The input string to capitalize

§Returns

  • String - The capitalized string

§Examples

use lowdash::capitalize;

assert_eq!(capitalize("hello"), "Hello");
assert_eq!(capitalize("WORLD"), "World");
assert_eq!(capitalize("rUsT"), "Rust");