trySplitWords | R Documentation |
This function attempts to split characters into its component words (and by default, all in lowercase) based on camelCase, PascalCase, or snake_case conventions. If the string doesn't match any of these conventions, it returns all groups of letters.
trySplitWords(..., conseq = TRUE, strictSnake = FALSE, uncase = TRUE)
... |
character(s) to be split, treated as a single vector after unlisting. |
conseq |
A logical indicating whether the |
strictSnake |
A logical indicating the |
uncase |
A logical indicating whether to remove all casing in the output to lowercase. |
A list of character vectors, each containing the parts of the string split into individual words.
splitCamel
, splitPascal
,
splitSnake
, isCamelCase
,
isPascalCase
, isSnakeCase
trySplitWords("camelCaseExample")
trySplitWords("PascalCaseExample")
trySplitWords(
"snake_case_example", c("more_snake_cases"), "third_snake_case"
)
trySplitWords("some|random|case")
trySplitWords("Space Words", "UPPER_CASE", uncase = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.