clippy_utils::str_utils

Function camel_case_start

source
pub fn camel_case_start(s: &str) -> StrIndex
Expand description

Returns index of the first camel-case component of s.

assert_eq!(camel_case_start("AbcDef"), StrIndex::new(0, 0));
assert_eq!(camel_case_start("abcDef"), StrIndex::new(3, 3));
assert_eq!(camel_case_start("ABCD"), StrIndex::new(4, 4));
assert_eq!(camel_case_start("abcd"), StrIndex::new(4, 4));
assert_eq!(camel_case_start("\u{f6}\u{f6}cd"), StrIndex::new(4, 6));