Function inflections::case::to_sentence_case[][src]

pub fn to_sentence_case(string: &str) -> String
Expand description

Converts any case into traditional sentence case without capitalizing the first letter.

Example

let sentence = "hello world".to_owned();
assert_eq!(to_sentence_case("hello world"), sentence);
assert_eq!(to_sentence_case("HELLO WORLD"), sentence);
assert_eq!(to_sentence_case("Hello World"), sentence);
assert_eq!(to_sentence_case("helloWorld"), sentence);
assert_eq!(to_sentence_case("HelloWorld"), sentence);
assert_eq!(to_sentence_case("hello-world"), sentence);
assert_eq!(to_sentence_case("Hello-World"), sentence);
assert_eq!(to_sentence_case("hello_world"), sentence);
assert_eq!(to_sentence_case("HELLO_WORLD"), sentence);