str_sentence: Modify sentence to Capitalize only first word

View source: R/str_sentence.R

str_sentenceR Documentation

Modify sentence to Capitalize only first word

Description

Coerces everything to lower case, then capitalizes the first word and every word after that isn't 2-3 letter commonly lowercase word.

"in", "is","on", "at", "to", "from", "by","and", "but", "or", "for", "nor", "a", "an" all kept lowercase by default, additional words can be supplied with noCaps argument

Usage

str_sentence(string, noCaps = NULL)

Arguments

string

string to put in sentence form

noCaps

Additional Words to not capitalize

Value

Character String with proper capitalization

Examples

string = "HelLO, thIS IS A SEnTance oF SpONgEBoB mOcKInG yOu"
str_sentense(string)

Ajfrick/ajfhelpR documentation built on June 30, 2023, 12:56 a.m.