toupper_first: Uppercase the First Character of Each Word in a String

Description Usage Arguments Value Examples

View source: R/toupper_first.R

Description

This function takes in a string of arbitrary length and returns a string of the same length with the first character in each word capitalized, assuming that character is alphabetic

Usage

1
toupper_first(string)

Arguments

string

String to modify

Value

Returns a string with the first character of each word capitalized, if that character is alphabetic.

Examples

1
2
3
4
5
6
7
8
toupper_first('new york')
## -> [1] "New York"

toupper_first('NEW YORK')
## -> [1] "New York"

toupper_first('5th avenue')
## -> [1] "5th Avenue"

michaeltoth/tothr documentation built on May 22, 2019, 9:52 p.m.