This function capitalizes the first character of each string in a given
string, based on the specified locale. This is similar to Python's
str.capitalize()
method.
Usage
strs_capitalize(string, locale = "en")
Arguments
- string
A character vector where each element is a string to be
capitalized.
- locale
A character string representing the locale to be used for
capitalization. Defaults to "en" (English). The locale affects the rules for
identifying sentences in the string.
Value
A character vector of the same length as string
, where each element
is the capitalized version of the corresponding element in string
.
Examples
strs_capitalize("hello world")
#> [1] "Hello world"