Skip to content

Instantly share code, notes, and snippets.

@shorepound
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shorepound/9136091 to your computer and use it in GitHub Desktop.
Save shorepound/9136091 to your computer and use it in GitHub Desktop.
public string MassageAddress(string line)
{
StringBuilder sb = new StringBuilder (line);
sb.Replace("# ","");
sb.Replace("#","");
line = sb.ToString();
string[] sParts = line.Split(' ');
for(int i = 0; i < sParts.Length; i++)
{
switch(sParts[i].ToString())
{
case "STE":
line = Regex.Replace(line,@" STE \w+","",RegexOptions.IgnoreCase);
break;
case "UNIT":
line = Regex.Replace(line,@" UNIT \w+","",RegexOptions.IgnoreCase);
break;
case "APT":
line = Regex.Replace(line,@" APT \w+","",RegexOptions.IgnoreCase);
break;
default:
break;
}
}
return line;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment