easy way to get the top level domain?

Posted by Michel on Stack Overflow See other posts from Stack Overflow or by Michel
Published on 2010-06-03T19:33:26Z Indexed on 2010/06/03 20:44 UTC
Read the original article Hit count: 179

Filed under:
|

Hi,

i want to get the domain extention (at least i hope it is called this way) from the site name the user is currently on.

so from www.bbc.co.uk it's co.uk and www.google.com = .com http://stackoverflow.com/questions/ask = .com

etc.

especially the ones with the double name (like co.uk) gives me headaches....

EDIT as i understand from the comments, co.uk is not a top level domain? that makes life easier! EDIT new name (top level domain) in the title

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET