R/propercase.R

Defines functions propercase

Documented in propercase

#' Function to convert text to proper case
#'
#' @param text a character vector
#' @return a character vector converted to "proper" case, where each word
#' starts with a capital, and all subsequent letters are lower case
#'
#' @export



propercase <- function(text) {
  gsub("(\\w)([\\w|']*)", "\\U\\1\\L\\2", text, perl = TRUE)
}
shug0131/cctu documentation built on June 12, 2025, 10:37 p.m.