case: Convert case of a string.

caseR Documentation

Convert case of a string.

Description

Convert case of a string.

Usage

str_to_upper(string, locale = "en")

str_to_lower(string, locale = "en")

str_to_title(string, locale = "en")

str_to_sentence(string, locale = "en")

Arguments

string

String to modify

locale

Locale to use for translations. Defaults to "en" (English) to ensure consistent default ordering across platforms.

Examples

dog <- "The quick brown dog"
str_to_upper(dog)
str_to_lower(dog)
str_to_title(dog)
str_to_sentence("the quick brown dog")

# Locale matters!
str_to_upper("i") # English
str_to_upper("i", "tr") # Turkish

stringr documentation built on Aug. 21, 2022, 1:07 a.m.