public static StripPortFromHost ( string host ) : string | ||
host | string | Host. |
return | string |
public static string StripPortFromHost(string host)
{
if (String.IsNullOrEmpty(host))
throw new ArgumentException("Cannot strip the port from a null host", "host");
return Regex.Replace(host, @":.*$", string.Empty);
}