capitalize_first_letter: Captitalize first letter of each word in a character string

View source: R/capitalize_first_letter.R

capitalize_first_letterR Documentation

Captitalize first letter of each word in a character string

Description

Captitalize first letter of each word in a character string

Usage

capitalize_first_letter(words = "", lower = FALSE)

Arguments

words

character string with one or more words in each element.

lower

logical indicating whether remaining characters will be forced to lower case.

Value

character string with first character of each word capitalized and remaining characters either left alone or are forced to lower case.

In many cases the user will want to use tools::toTitleCase instead.

Examples

library(stringi, quietly = TRUE)
capitalize_first_letter(words = c("a", "vector of words",
                                 "TO BE CAPITALIZED."))
capitalize_first_letter(words = c("a", "vector of words",
                                 "TO BE CAPITALIZED."), lower = TRUE)

rmsharp/rmsutilityr documentation built on Feb. 13, 2024, 6:01 p.m.