given an address in a string, i need to parse the address from the string and return the structure Address.
Signature: Address parseAddress(String address)
Input: String with address(e.g. “Lunkad Tower, 6th floor, \r\n Viman Nagar, \r\n Pune 411014")
Output: The structure Address
public class Address
{
public string Street {get;set;}; // Lunkad Tower, 6th floor
public string Locality {get;set;}; // Viman Nagar
public string City {get;set;}; // Pune
public string State {get;set;}; // MH, Maharashtra
public string PostalCode {get;set;}; // 60611
public string Country {get;set;}; // e.g. India, IN
}
Expected Output:
the application should parse all the given addresses in the attached input file. The output should be in a text file containing all the parsed addresses, where each parsed output address is in the following format:
Street|Locality|City|State|PostalCode|Country
Each address output should be in a new line.
In case any of the address field is missing, leave the space blank between the “|” (pipe) separators. Don’t remove the pipe separators.
For example, if State is not mentioned in the input string, the output should be: Street|Locality|City| |PostalCode|Country
can anyone help me write the code???