string myLocalLink = "https://www.mail.google.com/mail/u/1/#inbox";
myLocalLink = (new Uri(myLocalLink)).Host;
if (myLocalLink.ToString().StartsWith("www."))
{
myLocalLink = myLocalLink.ToString().Substring(4, myLocalLink.ToString().Length - 4);
}
result: mail.google.com
myLocalLink = (new Uri(myLocalLink)).Host;
if (myLocalLink.ToString().StartsWith("www."))
{
myLocalLink = myLocalLink.ToString().Substring(4, myLocalLink.ToString().Length - 4);
}
result: mail.google.com
No comments:
Post a Comment