What is the correct to format a string as a URL?
i.e.
‘google.com’ becomes ‘http://www.google.com’ and ‘www.stackoverflow.com’ becomes ‘http://www.stackoverflow.com.’
I imagine it is something using the Uriclass but from what I can tell, new Uri(mystring).AbsoluteUri doesn’t ‘format’ the string.
You can use the
UriBuilderclass to construct the URL. It will addHTTP://as a default scheme if the string doesn’t specify one.I found this out from an answer to this question Add scheme to URL if needed