I am retrieving the domain from a URL string but I'm wondering what is the best option to get it and avoid getting "co" in "example.co.uk" URLs.
Does anybody know about an algorithm or .NET framework method to do it?
I've been looking for it and the answers were to match the list of all TLDs and currently this list is growing quickly.
Edit:
I've already tried the Uri class and haven't found what I'm looking for.
I try to retrieve the first subdomain of a string like "website.example.co.uk" which would be "example.co.uk".