From: Tom Sawyer Date: 2002-07-12T00:52:34+09:00 Subject: Re: spliter of for...each: looping > arr.collect{|x| "junk#{x}morejunk" }.join(",") can you put conditionals in that? q = '' arr.each_with_nindex do |x, n| q << 'junk' << x q << 'morejunk' if x == 'more' q << ',' if n != -1 end ~transami On Thu, 2002-07-11 at 09:23, ts wrote: > >>>>> "T" == Tom Sawyer writes: > > T> q = '' > T> arr.each_with_nindex do |x, n| > T> q << 'junk' << x << 'morejunk' > T> q << ',' if n != -1 > T> end > > arr.collect{|x| "junk#{x}morejunk" }.join(",") > > > Guy Decoux > -- ~transami "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin