Skip to content

Instantly share code, notes, and snippets.

@sycue
Created May 3, 2012 10:09
Show Gist options
  • Save sycue/2584850 to your computer and use it in GitHub Desktop.
Save sycue/2584850 to your computer and use it in GitHub Desktop.
Ruby code to extract host from URL string
require 'uri'
myUri = URI.parse( 'http://www.mglenn.com/directory' )
print myUri.host
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment