2224 Mission Street San Francisco CA 94110
字符串应拆分为:
StreetName:2224 Mission Street
城市:旧金山
州:CA
zip:94110
答案 0 :(得分:0)
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;
但是有没有任何规则来划分街道和市2005?