Skip to contents

Capitalise first word or all words of a character vector. Lower back of vector element or word, respectively.

Usage

capitalizeStrings(x, all.words = FALSE, lower.back = FALSE)

Arguments

x

[character(n)]
Vector of character elements to capitalize.

all.words

[logical(1)]
If TRUE all words of each vector element are capitalized. FALSE capitalizes the first word of each vector element.

lower.back

[logical(1)]
TRUE lowers the back of each word or vector element (depends on all.words).

Value

Capitalized vector: [character(n)].

Examples

capitalizeStrings(c("the taIl", "wags The dOg", "That looks fuNny!"))
#> [1] "The taIl"          "Wags The dOg"      "That looks fuNny!"
capitalizeStrings(c("the taIl", "wags The dOg", "That looks fuNny!")
, all.words = TRUE, lower.back = TRUE)
#> [1] "The Tail"          "Wags The Dog"      "That Looks Funny!"