Learn R Programming

whapi (version 0.0.2)

whapi_only_digits: Keep only digits from a string

Description

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

Usage

whapi_only_digits(x)

Value

A string containing only numeric digits.

Arguments

x

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

Examples

Run this code
whapi_only_digits("(81) 98765-4321")
#> "81987654321"

Run the code above in your browser using DataLab