嘗試從地址中識別(和刪除)街道後綴(如「St」,「Dr」等...)。假設後綴是統一的,我們可以創建一個完整的列表。從地址中刪除街道後綴
謝謝!
street_suffix_list = ["St", "Dr", "Ave", "Blvd", "Tr"]
address = "105 Main St"
#returns "Main St"
street = address.gsub(/^((\d[a-zA-Z])|[^a-zA-Z])*/, '')
#desired: "St"
street_suffix =
#desired: "Main"
street_name =
你忘了寫一個問題。 –