Translate String with Case Mapping

Description

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

Usage

1
2
3
4
5

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.

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).

Value

Each function returns a character vector.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
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

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.