Subtext.Framework.BlogInfo.GetAlternateHostAlias C# (CSharp) 메소드

GetAlternateHostAlias() 공개 정적인 메소드

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.
리턴 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;
        }