Learn R Programming

strs (version 0.1.0)

strs_isdecimal: Check if string contains only decimal characters

Description

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)

Value

A logical vector of the same length as string, indicating whether each element contains only decimal characters.

Arguments

string

A character vector to be checked.

See Also

Examples

Run this code
strs_isdecimal("12345")
strs_isdecimal("123.45") # FALSE

Run the code above in your browser using DataLab