From: Gary Yngve Date: 2009-05-09T09:19:04+09:00 Subject: Re: ruby string slice/[] w/ range, weird end behavior On May 8, 4:47 pm, Eleanor McHugh wrote: > "foo"[3..3]                   => "" ... > index [3] is actually the end of the string so whilst the range   > accesses the string after any characters in it, it's still accessing   > the string in a valid range. Maybe in the native C. But why should that be exposed? And why shouldn't index[3] return "" if you are correct? After all: >> a=[]; "asd".each_byte{|x| a << x}; a => [97, 115, 100] If I ask for a substring entirely out of bounds, I should consistently be returned nil or "", not one of the two.