From: "Peña, Botp" Date: 2008-04-09T11:02:26+09:00 Subject: Re: output of a method to file? [mailto:list-bounce@example.com] On Behalf Of Zoe Phoenix # How can I make it cycle through the whole array without # having to edit c_list[number..number]? Is there a way to # automate that, so I only have to add cities to c_list # without having to add more code? of course, just do clist.join(' pets || ') eg irb session, irb(main):012:0> c_list=%w(Boston Nashville) => ["Boston", "Nashville"] irb(main):013:0> c_list.join(' pets || ') => "Boston pets || Nashville" irb(main):016:0> c_list += %w(Portland Atlanta Chicago) => ["Boston", "Nashville", "Portland", "Atlanta", "Chicago"] irb(main):017:0> c_list.join(' pets || ') => "Boston pets || Nashville pets || Portland pets || Atlanta pets || Chicago" irb(main):018:0> c_list += %w(Indianapolis Charleston Boston Nashville) => ["Boston", "Nashville", "Portland", "Atlanta", "Chicago", "Indianapolis", "Charleston", "Boston", "Nashville"] irb(main):019:0> c_list.join(' pets || ') => "Boston pets || Nashville pets || Portland pets || Atlanta pets || Chicago pets || Indianapolis pets || Charleston pets || Boston pets || Nashville" kind regards -botp