trySplitWords {FastUtils}R Documentation

Try to Split Words Based on Naming Convention

Description

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 does not match any of these conventions, it returns all groups of letters.

Usage

trySplitWords(..., conseq = TRUE, strictSnake = FALSE, uncase = TRUE)

Arguments

...

character(s) to be split, treated as a single vector after unlisting

conseq

A logical indicating whether the conseq argument in splitCamel()/ splitPascal() should be TRUE or FALSE.

strictSnake

A logical indicating the strict argument in isSnakeCase().

uncase

A logical indicating whether to remove all casing in the output to lowercase.

Value

A list of character vectors, each containing the parts of the string split into individual words.

See Also

splitCamel, splitPascal, splitSnake, isCamelCase, isPascalCase, isSnakeCase

Examples

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)


[Package FastUtils version 0.1.1 Index]