capitalize: Capitalize a Character Vector

Description Usage Arguments Value Examples

View source: R/strings.R

Description

Capitalize a Character Vector

Usage

1
capitalize(string, all = F)

Arguments

string

a character or character vector

all

logical, defauls to FALSE. If TRUE, will capitalize all words in each entry. Otherwise, only capitalizes first word.

Value

A character or character vector with either the first or all words capitalized.

Examples

1
2
3
4
capitalize("hello world") # "Hello world"
capitalize(c("hello world", "hello mom")) # c("Hello world", "Hello mom")
capitalize(c("hello world"), all = T) # "Hello World"
capitalize(c("hello world", "hello mom"), all = T) # c("Hello World", "Hello Mom")

mattgarber4/myUtils documentation built on Dec. 13, 2020, 12:54 p.m.