Robert Dober
6/28/2007 8:30:00 PM
On 6/28/07, fu <freeunli@yahoo.com> wrote:
> Martin, thanks! Should the behavior of "join" be like this or the docs
> are wrong?
>
>
>
Very surprised about this behavior, IMHO it is wrong, at least it is
inconsistent :
irb(main):007:0> a=[1,[2,[3,4],5],6]
=> [1, [2, [3, 4], 5], 6]
irb(main):008:0> a.join(",")
=> "1,2,3,4,5,6"
irb(main):009:0> b=[1,{2=>42},{3=>[4,5]}]
=> [1, {2=>42}, {3=>[4, 5]}]
irb(main):010:0> b.join(",")
=> "1,242,345"
Robert
--
I always knew that one day Smalltalk would replace Java.
I just didn't know it would be called Ruby
-- Kent Back