Skip to contents

strs_isdigit checks whether each element of a character vector contains only digits. It is similar to Python's str.isdigit() method.

Usage

strs_isdigit(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 digits.

Examples

strs_isdigit("12345")
#> [1] TRUE
strs_isdigit("123a")
#> [1] FALSE