str_remove_non_alphanum: Remove non-alphanumeric characters from a string. Optionally...

View source: R/str_remove_non_alphanum.R

str_remove_non_alphanumR Documentation

Remove non-alphanumeric characters from a string. Optionally remove spaces.

Description

Remove non-alphanumeric characters from a string. Optionally remove spaces.

Usage

str_remove_non_alphanum(string, keep_spaces = TRUE)

Arguments

string

A character string.

keep_spaces

Don't remove spaces.

Examples

remove_non_alphanum("222-44-6666")
[1] "222446666"
str_remove_non_alphanum("Devante Smith-Pelly", keep_spaces = F)
[1] "DevanteSmithPelly"

uva-bi-sdad/dc.utils documentation built on Aug. 1, 2022, 1:45 a.m.