Skip to main content

humanize_string_with

Function humanize_string_with 

Source
pub fn humanize_string_with(string: &str, preserve_case: bool) -> String
Expand description

Make string human-readable, optionally preserving the original casing.

When preserve_case is false (the default in humanize_string), the input is first de-camelcased and lower-cased. When true, the casing is kept as-is and only whitespace normalization and the leading capitalization are applied.

assert_eq!(humanize_string_with("my_url_string", false), "My url string");