Function inflections::case::to_kebab_case[][src]

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

Converts any case into kebab-case.

Example

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