Skip to content

Latest commit

 

History

History

extractTheDomainNameFromAUrl

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Extract the domain name from a URL

5 kyu link to kata
my solution

Write a function that when given a URL as a string, parses out just the domain name and returns it as a string. For example:

* url = "http://github.com/carbonfive/raygun" -> domain name = "github"
* url = "http://www.zombie-bites.com"         -> domain name = "zombie-bites"
* url = "https://www.cnet.com"                -> domain name = cnet"