title: What is the fastest way to get the domain/host name from a URL?
body: <p>I need to go through a large list of string url's and extract the domain name from them.</p>
  
  <p>For example:</p>
  
  <p><strong>http://www.stackoverflow.com/questions</strong> would extract <strong>www.stackoverflow.com</strong></p>
  
  <p>I originally was using <code>new URL(theUrlString).getHost()</code> but the URL object initialization adds a lot of time to the process and seems unneeded.</p>
  
  <p>Is there a faster method to extract the host name that would be as reliable?</p>
  
  <p>Thanks</p>
  
  <p><strong>Edit:</strong> My mistake, yes the www. would be included in domain name example above.  Also, these urls may be http or https</p>