Skip to content

Removes all non-digit characters from the input string. Useful for cleaning phone numbers, CNPJs/CPFs, or process codes.

Usage

whapi_only_digits(x)

Arguments

x

Character vector or string. If NULL, an empty string is used.

Value

A string containing only numeric digits.

Examples

whapi_only_digits("(81) 98765-4321")
#> [1] "81987654321"
#> "81987654321"