From: Tom Armitage Date: 2006-10-20T00:20:34+09:00 Subject: Re: array trouble Also: "abcd".split("").map do |w| w + " " end.join would give you the extra space at the end. On 19/10/06, Gijs Nijholt wrote: > Hi > > I want to add a value to an arrays' values like this: > > ret = "" > "abcd".to_a.each do |w| > ret += " " > end > > this gives => "abcd" in IRB > but I expected it to give "a b c d " > > why doesnt this work as such? > thanks > > gijs > > -- > Posted via http://www.ruby-forum.com/. > >