strs_capitalize: Capitalize the first character of each sentence

View source: R/capitalize.R

strs_capitalizeR 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")

strs documentation built on Sept. 11, 2024, 6:44 p.m.