I would like to write a function to seperate random address strings into:
1. street name (A)
2. street number (B)
3. street number prefix/suffix (C)
I'll write down some examples of addresses and what the output should be:
Address 1: "Kastanievej 15"
A -> "Kastanievej"
B -> "15"
C -> ""
Address 2: "Albertinkatu 36 B"
A -> "Albertinkatu"
B -> "36"
C -> "B"
Address 3: "Albertinkatu st. 36/B"
A -> "Albertinkatu"
B -> "36"
C -> "B"
Address 4: "Albertinkatu street A/36"
A -> "Albertinkatu"
B -> "36"
C -> "A"
It gets trickier in England or USA for example, where the notation is "number, street name".
Address 5: "12 Harbour Parade"
A -> "Harbour Parade"
B -> "12"
C -> ""
Also, you can have number in a street name...:
Address 6: "330 W 20th St"
A -> "W 20th St"
B -> "330"
C -> ""
...Or in EU:
Address 6: "Ulica 28. maja 16"
A -> "Ulica 28. maja "
B -> "16"
C -> ""
The code will be something like this:
Code:
function split.address(string address, ref street, ref number, ref pre.suff)
{
....
}
My main goal for the moment is to split address strings for EU where
address notation usually is: "street name" "prefix" "housenumber" "sufux"
Any ideas how to approach this in baan C?