Subtext.Framework.BlogInfo.StripPortFromHost C# (CSharp) Method

StripPortFromHost() public static method

Strips the port number from the host name.
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);
        }