Given all the pieces of a mail address (address line 1, line2, city, zip, state, country), is there a programmatic way to format a mail address according to a given country's format standard? From the Wiki of address formats it's not easy to spot a pattern. Would a solution look like a giant switch statement? If USA, display address this way, if Poland display address this way.
Asked
Active
Viewed 34 times
0
-
Short answer: No. Long answer: If you do find a way that works and doesn't arbitrarily mangle data, make a Rubygem and we'd all appreciate it. Good luck dealing with Japanese and British addresses. – tadman May 19 '17 at 02:08
-
1http://stackoverflow.com/q/5840626/62576 – Ken White May 19 '17 at 02:11