Function stringcase::kebab_case_with_nums_as_word

source ยท
pub fn kebab_case_with_nums_as_word(input: &str) -> String
Expand description

Converts a string to kebab case.

This function takes a string slice as its argument, then returns a String of which the case style is kebab case.

This function targets the upper and lower cases of ASCII alphabets and ASCII numbers for capitalization, and all characters except ASCII alphabets and ASCII numbers are replaced to hyphens as word separators.

    let kebab = stringcase::kebab_case_with_nums_as_word("fooBar123Baz");
    assert_eq!(kebab, "foo-bar-123-baz");