[ACCEPTED]-Ruby code to extract host from URL string-ruby
Accepted answer
You could try something like this:
require 'uri'
myUri = URI.parse( 'http://www.mglenn.com/directory' )
print myUri.host
# => www.mglenn.com
0
URI("http://www.mglenn.com/directory").host
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.