Skip to contents

str_reverse() reverses the order of the Unicode code points in each string.

Usage

str_reverse(string)

Arguments

string

Input vector. Either a character vector, or something coercible to one.

Value

A character vector the same length as string.

See also

stringi::stri_reverse() for the underlying implementation.

Examples

str_reverse(c("abc", "caf\u00e9", NA))
#> [1] "cba"  "éfac" NA