Farrel Lifson
10/19/2006 1:38:00 PM
On 19/10/06, akbarhome <akbarhome@gmail.com> wrote:
> Hi,
>
> This is the code:
> a = [ 'a', 'b' ]
> b = 2
> stringbla = "home #{ a.each {|i| i * b } } work"
> puts stringbla
>
> output:
> home ab work
>
> How do I modifiy the iterator so the output will be:
> home aabb work
>
> Thank you.
stringbla = "home #{ a.map {|i| i * b } } work"
Farrel