simple_cap: Capitalize the first letter of each element and/or word in a...

View source: R/simple_cap.R

simple_capR Documentation

Capitalize the first letter of each element and/or word in a vector of character strings

Description

Capitalize the first letter of each word in each element of a character vector. By default, words are assumed to be separated " ".

Usage

simple_cap(x, sep_str=" ")

Arguments

x

character vector, with elements to be capitalized.

sep_str

character string, the separator between words within vector elements. Vector elements are split on this string, each chunk is capitalized, and they are combined with this string as separator. Defaults to " ".

Value

a character vector of the same length as x.


mjdufort/miscHelpers documentation built on Feb. 4, 2024, 7:44 p.m.