strs_capitalize {strs} | R Documentation |
Capitalize the first character of each sentence
Description
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
.
See Also
Python str.capitalize() documentation
Examples
strs_capitalize("hello world")
[Package strs version 0.1.0 Index]