Learn R Programming

stringi (version 0.1-25)

stri_trans_tolower: Translate String with Case Mapping

Description

These functions translate strings either to lower case, UPPER CASE, or to Title Case.

Usage

stri_trans_tolower(str, locale = NULL)

stri_trans_toupper(str, locale = NULL)

stri_trans_totitle(str, locale = NULL)

Arguments

str
character vector
locale
NULL or "" for case mapping following the conventions of the default locale, or a single string with locale identifier, see stringi-locale.

Value

  • Each function returns a character vector.

Details

ICU implements full Unicode string case mappings. In general,
  • case mapping can change the number of code points and/or code units of a string,
  • is language-sensitive (results may differ depending on locale), and
  • is context-sensitive (a character in the input string may map differently depending on surrounding characters).

References

Case Mappings -- ICU User Guide, http://userguide.icu-project.org/transforms/casemappings

See Also

Other locale_sensitive: stri_cmp, stri_compare; stri_count_fixed; stri_detect_fixed; stri_enc_detect2; stri_locate_all_fixed, stri_locate_all_fixed,, stri_locate_first_fixed, stri_locate_first_fixed,, stri_locate_last_fixed, stri_locate_last_fixed; stri_opts_collator; stri_order, stri_sort; stri_replace_all_fixed, stri_replace_all_fixed, stri_replace_first_fixed, stri_replace_first_fixed, stri_replace_last_fixed, stri_replace_last_fixed; stri_split_fixed, stri_split_fixed; stringi-locale; stringi-search-fixed

Examples

Run this code
stri_trans_toupper("\u00DF", "de_DE") # small German double s
stri_trans_toupper("i", "en_US") != stri_trans_toupper("i", "tr_TR")
stri_trans_toupper(c('abc','123','\u0105\u0104'))

stri_trans_tolower(c('AbC','123','\u0105\u0104'))

stri_trans_totitle(c('AbC','123','\u0105\u0104'))
stri_trans_totitle("aLA mA kOTA")

stri_trans_totitle('taming of the shrew', locale='en_US') # TODO: we are working on this

Run the code above in your browser using DataLab