This function splits strings formatted in camelCase or PascalCase into their component words. It can handle words where uppercase letters transition to lowercase letters, and it is capable of handling strings with sequences of uppercase letters followed by lowercase letters, effectively separating acronyms from camelCase beginnings.
Value
A list of character vectors, each containing the parts of the
corresponding CamelCase or PascalCase string split at the appropriate
transitions. If conseq
is FALSE, acronyms followed by words are
separated.
Examples
splitCamel("splitCamelCaseIntoWords")
#> [[1]]
#> [1] "split" "Camel" "Case" "Into" "Words"
#>
splitCamel(c("fooBar", "FOOBar", "anotherFOOBarTest"), conseq = FALSE)
#> [[1]]
#> [1] "foo" "Bar"
#>
#> [[2]]
#> [1] "F" "O" "O" "Bar"
#>
#> [[3]]
#> [1] "another" "F" "O" "O" "Bar" "Test"
#>