simpleCap: Capitalize first letter of each word

View source: R/simpleCap.R

simpleCapR Documentation

Capitalize first letter of each word

Description

given multi-word vector, capitalize the first letter of each word. Taken from 'Examples' section of ?toupper

Usage

simpleCap(x, lowerCaps_v = T)

Arguments

x

vector

lowerCaps_v

boolean indicating if capitalized letters (that are not the first letter in each word) should be left capitalized or changed to lower case.

Value

same as X, but each first letter is capitalized.

Examples

a <- "capitalize the first letter"
b <- "optionally RETURN other CAPS to lower"
c <- c("works with multiple", "strings at once")
simpleCap(a)
simpleCap(b)
simpleCap(b, F)
simpleCap(c)

weshorton/wrh.rUtils documentation built on Oct. 28, 2024, 7:24 a.m.