From: "Jesús Gabriel y Galán" Date: 2009-01-27T21:27:10+09:00 Subject: Re: Name Extraction On Tue, Jan 27, 2009 at 12:05 PM, Newb Newb wrote: > i have following string > > jayabharathy@angleritech.com~Vs~kannan@angleritech.com > > the above string has 2 email ids in it.but i need only names of it. > > i want to extract only the names Take a look at the split method in String: http://www.ruby-doc.org/core/classes/String.html#M000818 For example: irb(main):001:0> a = "jayabharathy@angleritech.com~Vs~kannan@angleritech.com" => "jayabharathy@angleritech.com~Vs~kannan@angleritech.com" irb(main):006:0> a.split(/[@~]/) => ["jayabharathy", "angleritech.com", "Vs", "kannan", "angleritech.com"] Hope this helps, Jesus.