From: Louis J Scoras Date: 2006-10-19T22:41:40+09:00 Subject: Re: iterator inside string On 10/19/06, akbarhome wrote: > How do I modifiy the iterator so the output will be: > home aabb work > > Thank you. The to_s method is going to be called on whatever value the #{ ... } evaluates to. That's why you are getting "ab" a.each {|i| i * b}.to_s # => "ab" if you use collect rather than each, you'll get x = a.collect {|i| i * b} # => ["aa", "bb"] x.to_s # => "aabb" -- Lou.