first_digit: String methods

Description Usage Arguments Value Examples

View source: R/strings.R

Description

Extract the first digit (if available) from the characters of a string.

Usage

1
first_digit(string)

Arguments

string

An object that inherits from class "character".

Value

Returns the first digit (0-9) or NA if no digits are found.

Examples

1
first_digit("aBc-def84hj")

bgreenwell/bmisc documentation built on Sept. 24, 2019, 11:09 a.m.