Normalize postal codes to the correspondence's own format
Source:R/postal.R
normalize_postal_code.RdUppercases, strips whitespace, and re-inserts a single space in the middle
of a six-character code, producing the "A1A 1A1" form that
resolve_postal() reports in its postal_code column. Use it to build a
join key on your own records: joining on the column as typed silently drops
every code that was not already in that exact form.
Examples
normalize_postal_code(c("m5v3a8", "M5V 3A8", " m5v 3a8 "))
#> [1] "M5V 3A8" "M5V 3A8" "M5V 3A8"