public static string GetDisplayUrl(Uri urlToDisplay)
        {
            Uri    displayUri    = UriFormatter.ShortenUri(urlToDisplay);
            string displayText   = displayUri.ToString();
            int    afterProtocol = displayText.IndexOf("://");

            if (afterProtocol > 0)
            {
                displayText = displayText.Substring(afterProtocol + 3);
            }
            if (displayText.EndsWith("/"))
            {
                displayText = displayText.Substring(0, displayText.Length - 1);
            }
            return(displayText);
        }
        /// <summary>
        /// Gets a URI for sending an email without exposing an email address to spambots
        /// </summary>
        /// <param name="emailAddress">The email address</param>
        /// <param name="recipientName">The name of the email recipient</param>
        /// <param name="baseUrl">The base URL.</param>
        /// <returns></returns>
        public static Uri GetWebsiteEmailFormUri(string emailAddress, string recipientName, Uri baseUrl)
        {
            if (string.IsNullOrEmpty(emailAddress))
            {
                return(null);
            }

            int atPos = emailAddress.IndexOf("@", StringComparison.Ordinal);

            if (atPos <= 0)
            {
                return(null);
            }

            string emailAccount = emailAddress.Substring(0, atPos);
            string emailDomain  = emailAddress.Substring(atPos + 1);

            return(UriFormatter.GetWebsiteEmailFormUri(emailAccount, emailDomain, recipientName, baseUrl));
        }
 /// <summary>
 /// Obfuscate an email address to hide it from at least the dumber spam-bots
 /// </summary>
 /// <param name="emailAddress">Email address to encode</param>
 /// <returns>Series of XHTML entity references representing the email address</returns>
 public static string ConvertEmailToEntities(string emailAddress)
 {
     return(UriFormatter.ConvertEmailToEntities(emailAddress, false));
 }