isSnakeCase {FastUtils} | R Documentation |
Check if String is snake_case
Description
This function checks if a given string adheres to snake_case naming conventions. By default (strict = TRUE), it only allows lowercase letters separated by underscores. If strict is FALSE, uppercase letters are also permitted.
Usage
isSnakeCase(x, strict = TRUE)
Arguments
x |
A character string to check. |
strict |
Logical indicating whether the string should strictly contain only lowercase letters (TRUE) or can include uppercase letters (FALSE). Default is TRUE. |
Value
TRUE if the string is snake_case according to the specified strictness, FALSE otherwise.
Examples
isSnakeCase("snake_case") # returns TRUE
isSnakeCase("Snake_Case") # returns FALSE
isSnakeCase("snake_case", FALSE) # returns TRUE
isSnakeCase("Snake_Case", FALSE) # returns TRUE
[Package FastUtils version 0.1.1 Index]