clippy_utils::str_utils

Function camel_case_indices

source
pub fn camel_case_indices(s: &str) -> Vec<StrIndex>
Expand description

Get the indexes of camel case components of a string s

assert_eq!(
    camel_case_indices("AbcDef"),
    vec![StrIndex::new(0, 0), StrIndex::new(3, 3), StrIndex::new(6, 6)]
);
assert_eq!(
    camel_case_indices("abcDef"),
    vec![StrIndex::new(3, 3), StrIndex::new(6, 6)]
);