Function stringcase::kebab_case_with_keep

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

Converts a string to kebab case using characters other than the specified characters as separators.

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

This function targets only the upper and lower cases of ASCII alphabets for capitalization, and the characters other than the specified characters as the second argument of this function are regarded as word separators and are replaced to hyphens.

    let kebab = stringcase::kebab_case_with_keep("foo-Bar100%Baz", "%");
    assert_eq!(kebab, "foo-bar100%-baz");