From: Ilan Berci Date: 2009-02-03T05:25:58+09:00 Subject: Re: Noob question: while or for loop within a list Darin, Don't let white space get you down.. list.split(/\s*,\s*/).each do ilan Darin Ginther wrote: > Thank you guys. > Obviously I need to be more aware of my white space in Ruby. I've put > the two examples below - both one via a list and one via an array. > > # List > list = "url1, url2, url3, url4, url5" > list.split(", ").each do |url| > puts url > end > > > #Array > urls = %w{http://test1.com http://test2.com} > urls.each do |url| > puts "URL is #{url}" > end -- Posted via http://www.ruby-forum.com/.