require 'uri'

  uri = URI.parse("http://www.ruby-lang.org/";)
  p uri
  # => #<URI::HTTP:0x202281be URL:http://www.ruby-lang.org/>
  p uri.scheme
  # => "http"
  p uri.host
  # => "www.ruby-lang.org"

http://www.ruby-doc.org/core/classes/URI.html


On May 28, 1:57 pm, Sean Six <[email protected]> wrote:
> Suppose a user submits a url:http://www.nyt.com/education/2345545.  How
> can this be shortened to a cleaner url, like nyt.com?
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to