George George

George George

  • NA
  • 778
  • 0

how to get domain part from URL

Jul 21 2008 11:22 PM

Hello everyone,


Suppose I have an URL, and I want to get the domain part, for example, URL is, http://abc.com/some/address/abc.html, the domain is abc.com.

My questions are,

- Are there any existing utility class to do this? Not all URLs begins with protocol part, like http://, and not all ends with /, so I feel hard when I try to write a parser by myself;

- Is domain case sensitive or not? i.e. abc.com the same as ABc.Com?


thanks in advance,
George


Answers (4)