From: sharmin malik Date: 2012-09-10T06:58:43+09:00 Subject: Re: Need help with my logic 7stud -- wrote in post #1075239: > given_server = "DK-vk-2.domain.lan" > server_types = ['vk', 'vh', 'vm'] > > start, type, the_rest = given_server.split('-') > puts type > > --output:-- > vk > > other_two = (server_types - [type]).map do |new_type| > [start, new_type, the_rest].join('-') > end > > p other_two > > --output:-- > ["DK-vh-2.domain.lan", "DK-vm-2.domain.lan"] Hi also could you please explain to me , how it working ?? other_two = (server_types - [type]).map do |new_type| [start, new_type, the_rest].join('-') end how it deleting vk from the list ?? -- Posted via http://www.ruby-forum.com/.