I have some strings like this:
www.example.com/sdWqaP
twitter.com/sdfks
and want to assign them to a HyperLink
var hyperlink = new Hyperlink
{
NavigateUri = new Uri(url),
TargetName = "_blank",
};
if url starts with http://
it works fine, otherwise throws a UriFormatException
.
Update: urls like this www.google.com
aren't valid http
urls. isn't there a better way than var url = "http://" + "www.google.com"