capitalize: Capitalize the first letter of each word

View source: R/utils.R

capitalizeR Documentation

Capitalize the first letter of each word

Description

Capitalize the first letter of each word

Usage

capitalize(x, force_tolower = FALSE)

Arguments

x

A vector of character strings to be capitalized.

force_tolower

Whether to force the remaining letters to be lowercase.

Examples

x <- c(
  "hello world",
  "hello World"
)
capitalize(x)

thisutils documentation built on May 24, 2026, 5:07 p.m.