DEV Community

loading...

Discussion on: Daily Challenge #89 - Extract domain name from URL

Collapse
mauamy profile image
mauamy

Python one-liner:

def domain_name(url):
    return url.split("/")[2].split(".")[-2]