From: Hugh Sasse Staff Elec Eng Date: 2000-06-20T09:57:05+01:00 Subject: [ruby-talk:03552] Re: A small quiz On 20 Jun 2000, Dave Thomas wrote: > > > Andy and I were surprised by a Ruby feature. If you'd like, answer the > following three questions without executing the code, then try it in > Ruby and see if you were right. > > a = "hi" > p a[0,1] #=> "h" > p a[1,1] #=> ? > p a[2,1] #=> ? > p a[3,1] #=> ? > > Anyone else surprised? I did not expect that result. I was more surprised when I used p a[x,1].dump but explaining why I was surprised would give others a clue... > > > Dave > > Hugh hgs@dmu.ac.uk