Learn R Programming

strs (version 0.1.0)

strs_isalnum: Check if string is alphanumeric

Description

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)

Value

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

Arguments

string

A character vector to be checked.

See Also

Examples

Run this code
strs_isalnum("hello123")
strs_isalnum("hello world")
strs_isalnum("12345")

Run the code above in your browser using DataLab