I hope this gets you started: you may need to modify the code here depending on the range of possible formats the string you need to parse arrives in.
private string[] split1 = new string[]{"P2"};
private string[] split2 = new string[] {"MAP"};
private char[] toTrim = new char[] {' ',':','@'};
public string responseToAddress(string response)
{
string address = response.Split(split1,2, StringSplitOptions.RemoveEmptyEntries)[1];
address = address.Split(split2, StringSplitOptions.RemoveEmptyEntries)[0];
return address.Trim().TrimStart(toTrim);
}
You could also achieve something like this using a Regular Expression.