stri_trans_casemap: Transform Strings with Case Mapping

Description Usage Arguments Details Value References See Also Examples

Description

These functions transform 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.

...

additional settings for opts_brkiter

opts_brkiter

a named list with ICU BreakIterator's settings, see stri_opts_brkiter; NULL for default break iterator, i.e., word; stri_trans_totitle only

Details

Vectorized over str.

ICU implements full Unicode string case mappings. It is worth noting that, generally, case mapping:

With stri_trans_totitle, if word BreakIterator is used (the default), then the first letter of each word will be capitalized and the rest will be transformed to lower case. With the break iterator of type sentence, the first letter of each sentence will be capitalized only. Note that according the ICU User Guide, the string 'one. two. three.' consists of one sentence.

For more general (but not locale dependent) text transforms refer to stri_trans_general.

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: %s<%(), about_locale, about_search_boundaries, about_search_coll, stri_compare(), stri_count_boundaries(), stri_duplicated(), stri_enc_detect2(), stri_extract_all_boundaries(), stri_locate_all_boundaries(), stri_opts_collator(), stri_order(), stri_sort_key(), stri_sort(), stri_split_boundaries(), stri_unique(), stri_wrap()

Other transform: stri_trans_char(), stri_trans_general(), stri_trans_list(), stri_trans_nfc()

Other text_boundaries: about_search_boundaries, about_search, stri_count_boundaries(), stri_extract_all_boundaries(), stri_locate_all_boundaries(), stri_opts_brkiter(), stri_split_boundaries(), stri_split_lines(), stri_wrap()

Examples

1
2
3
4
5
6
7
stri_trans_toupper('\u00DF', 'de_DE') # small German Eszett / scharfes S
stri_cmp_eq(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('cOOkiE mOnSTeR likes COOKIES. Here HE comes!') # word boundary
stri_trans_totitle('cOOkiE mOnSTeR likes COOKIES. Here HE comes!', type='sentence')

stringi documentation built on Sept. 13, 2020, 5:17 p.m.