Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js get website short name

function extractWebsiteName(url) {
  let name = url.replace(/(http(s)?):///, '')

  name = name.replace('www.', '')

  name = name.split('/')[0].split(':')[0]

  return name
}
 
PREVIOUS NEXT
Tagged: #js #website #short
ADD COMMENT
Topic
Name
9+1 =