method

extract_subdomain

Importance_1
extract_subdomain(host, tld_length) public

Returns the subdomains of a host as a String given the domain level.

# Top-level domain example
extract_subdomain('www.example.com', 1) # => "www"
# Second-level domain example
extract_subdomain('dev.www.example.co.uk', 2) # => "dev.www"
Show source
Register or log in to add new notes.