S
Srikanth Jeeva
hi,
Suppose if i give,
url="www.google.com/picasa/images/1"
I need only the string "google" which is the domain name.
right now i have tried this,
require 'rubygems'
require 'uri'
url = "http://www.google.com/picasa/images/1"
puts url = URI.parse(url).host
-----------
output: "google.com"
-----------
but i want only the word "google". please help.
Pts:
the domain name can also be, "google.co.in"
ie) for example, "http://www.google.co.in/picasa/images/1"
Thanks in advance,
srikanth
Suppose if i give,
url="www.google.com/picasa/images/1"
I need only the string "google" which is the domain name.
right now i have tried this,
require 'rubygems'
require 'uri'
url = "http://www.google.com/picasa/images/1"
puts url = URI.parse(url).host
-----------
output: "google.com"
-----------
but i want only the word "google". please help.
Pts:
the domain name can also be, "google.co.in"
ie) for example, "http://www.google.co.in/picasa/images/1"
Thanks in advance,
srikanth