Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

stri_rand_shuffle

Randomly Shuffle Code Points in Each String


Description

Generates a (pseudo)random permutation of the code points in each string.

Usage

stri_rand_shuffle(str)

Arguments

str

character vector

Details

This operation may result in non-Unicode-normalized strings and may give peculiar outputs in case of bidirectional strings.

See also stri_reverse for reversing the order of code points.

Value

Returns a character vector.

See Also

Examples

stri_rand_shuffle(c('abcdefghi', '0123456789'))
# you can do better than this with stri_rand_strings:
stri_rand_shuffle(rep(stri_paste(letters, collapse=''), 10))

stringi

Character String Processing Facilities

v1.6.1
file LICENSE
Authors
Marek Gagolewski [aut, cre, cph] (<https://orcid.org/0000-0003-0637-6028>), Bartek Tartanus [ctb], and others (stringi source code); IBM, Unicode, Inc. and others (ICU4C source code, Unicode Character Database)
Initial release
2021-05-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.