R/tidy_postcode.R

Defines functions tidy_postcode

#' @export
tidy_postcode <- function(x) {
  x %>%
    stringr::str_to_upper() %>%
    stringr::str_remove_all(" ") %>%
    stringr::str_replace_all("(.*)(.{3})$", "\\1 \\2")
}
botan/bfun documentation built on June 15, 2022, 8:44 a.m.