Skip to contents

strs_isalnum checks whether each element of a character vector is alphanumeric. This means that the function tests if all characters in the string are either letters or digits. It is similar to Python's str.isalnum() method.

Usage

strs_isalnum(string)

Arguments

string

A character vector to be checked.

Value

A logical vector of the same length as string, with each element indicating whether the corresponding element of string is completely alphanumeric.

Examples

strs_isalnum("hello123")
#> [1] TRUE
strs_isalnum("hello world")
#> [1] FALSE
strs_isalnum("12345")
#> [1] TRUE