strs_isdigit: Check if string contains only digits

View source: R/isdigit.R

strs_isdigitR Documentation

Check if string contains only digits

Description

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.

See Also

Python str.isdigit() documentation

Examples

strs_isdigit("12345")
strs_isdigit("123a")

strs documentation built on Sept. 11, 2024, 6:44 p.m.