Skip to contents

strs_isascii determines whether each element of a character vector contains only ASCII characters. It is similar to Python's str.isascii() method.

Usage

strs_isascii(string)

Arguments

string

A character vector to be checked.

Value

A logical vector of the same length as string, indicating whether each element contains only ASCII characters.

Examples

strs_isascii("hello")
#> [1] TRUE
strs_isascii("héllo")
#> [1] FALSE