Split a URL : URI « Network « Ruby






Split a URL


require 'uri'

puts URI.split('http://example.com/a/file.html')
# => ["http", nil, "example.com", nil, nil, "/a/file.html", nil, nil, nil]

 








Related examples in the same category

1.Parsing URLs
2.URI::HTTP.component
3.URI::MailTo.component
4.Create a URL with URI::HTTP.build
5.Dump a URL
6.mailto URI parse
7.URI parse
8.Extracting All the URLs from an HTML Document
9.Get only http and https based url