2224 Mission Street San Francisco CA 94110
The string should be split into :
StreetName : 2224 Mission Street
City: San Francisco
state: CA
zip: 94110
2224 Mission Street San Francisco CA 94110
The string should be split into :
StreetName : 2224 Mission Street
City: San Francisco
state: CA
zip: 94110
var address = ("2224 Mission Street San Francisco CA 94110").trim().replace(" ",""),
zip = address.substring(address.length-5, address.length), //provided zip in at the end of the string and it's 5 digit.
state = address.substring(address.length-7, address.length-5)// provided state contains two characters;
But is there any rule to divide street & ciry?