I have a code for conversion but some address have different result to what is expected.
23 Starling St => 3 Streetarling Street which is wrong and it should be 23 Starling Street
1 St Johns Ct => 1 Street Johns Ct => Correct
This is the code:
private string StreetConversion(string address, Order order)
{
string[] addressList = address.Split(' ');
foreach (string add in addressList)
{
if(add == "pde")
address = address.Replace("pde", "Parade");
if (add == "Pde")
address = address.Replace("Pde", "Parade");
if (add == "Rd")
address = address.Replace("Rd", "Road");
if (add == "rd")
address = address.Replace("rd", "Road");
if (add == "St")
address = address.Replace("St", "Street");
if (add == "st")
address = address.Replace("st", "Street");
}
order.ShipAddress1 = address;
return address;
}