Skip to contents

strs_isdecimal checks whether each element of a character vector contains only decimal characters. It is similar to Python's str.isdecimal() method.

Usage

strs_isdecimal(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 decimal characters.

Examples

strs_isdecimal("12345")
#> [1] TRUE
strs_isdecimal("123.45") # FALSE
#> [1] FALSE