Function stringcase::train_case_with_nums_as_word

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

Converts a string to train case.

This function takes a string slice as its argument, then returns a String of which the case style is train 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 train = stringcase::train_case_with_nums_as_word("fooBar123Baz");
    assert_eq!(train, "Foo-Bar-123-Baz");