Sterilises strings, capitalising, removing punct. and spaces. Mostly for matching applications

rmPWCap(text_to_clean, rm_all_white_space = F)

Arguments

text_to_clean

A character vector.

rm_all_white_space

A boolean indicating whether all (not just trailing and double whitespace) should be stripped. Setting to false obviously preserves semantic meaning, but in eaither instance peripherial and sequential white space is always stripped.

Value

A character vector x capitalised and devoid of Punctuation and trailing, double (and, optionally all whitespace)

Examples

rmPWCap(c('He1l0 ! WoR1D'))
#> [1] "HE1L0 WOR1D"
rmPWCap(c('He1l0 ! WoR1D'),rm_all_white_space=TRUE)
#> [1] "HE1L0WOR1D"