From: Todd Burch Date: 2007-08-24T08:14:15+09:00 Subject: Re: subarray using [1,-1] returns nil. Todd Burch wrote: > a = %w(a b c d e f g) ; > puts "a.length = #{a.length}" ; > > b = a[1,-1] ; > puts "b.length = #{b.length}" ; > > Why is array b nil after the subarray? I expect it to be equal to "a" > minus the first element. > > Todd I think I see the issue (the issue = my error). The "-1" is the last element of the array, and the method is epxecting a length, not an element. Todd -- Posted via http://www.ruby-forum.com/.