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

GetAlternateHostAlias() public static method

If the host starts with www., gets the host without the www. If it doesn't start with www., returns the host with www.
public static GetAlternateHostAlias ( string host ) : string
host string Host.
return string
        public static string GetAlternateHostAlias(string host)
        {
            if (String.IsNullOrEmpty(host))
                throw new ArgumentException("Cannot get an alternative alias to a null host", "host");

            if (host.StartsWith("www.", StringComparison.CurrentCultureIgnoreCase))
                return StripWwwPrefixFromHost(host);
            else
                return "www." + host;
        }