string_cases: Modify cases for strings

string_upperR Documentation

Modify cases for strings

Description

Modify the case of the string.

Usage

string_upper(s)
string_lower(s)
string_swapcase(s)
string_titlecase(s)

Arguments

s

A string (character) vector.

Details

The upper() functions make all characters in a string vector in their capitalized case.

The string_lower() function makes the same vector in their lower case.

The string_swapcase() function switches the case for each character in a string vector.

The string_titlecase() function converts the first character of each word to uppercase.

The synonym pattern of these functions are s_*() and *() (replace asterisks with upper, lower, swapcase, or titlecase).

Value

Character vector.

See Also

https://github.com/robertschnitman/stringops

Examples

string_upper(rownames(mtcars))
string_lower(rownames(mtcars))
string_swapcase(rownames(mtcars))


robertschnitman/stringops documentation built on Aug. 15, 2022, 3:46 p.m.