This function extracts all digits found in character vector and returns them as a list.
getDigits(x, collapse = NULL)
x | a character vector where digits are sought, or an object which can be coerced by |
---|---|
collapse | an optional character string to separate the results (see [base::paste()). |
A list of digits.
getDigits('txt012-34')#> [[1]] #> [1] "012" "34" #>