From: timr Date: 2010-08-23T17:51:02+09:00 Subject: assert "foo"[3] != "foo"[3,1]...revisited consider the following irb session; >> "foo"[0] => "f" >> "foo"[1] => "o" >> "foo"[2] => "o" >> "foo"[3] => nil >> "foo"[4] => nil >> "foo"[0,3] => "foo" >> "foo"[1,3] => "oo" >> "foo"[2,3] => "o" #note the following weird case!!! >> "foo"[3,3] => ""  #this should be nil in my mind, "foo"[3] is nil, and taking three characters is still nil. >> "foo"[4,3] => nil So, to summarize, when indexing a position beyond the length of a string, ruby returns nil. But when indexing a slice beyond the length of a string, ruby returns an empty string "" for the first index beyond and then nil. I don't like that this passes assert "foo"[3] != "foo"[3,1] Matz, you are so smart, but this does not follow the principle of least surprise!!! こんなことはへんじゃないすか。 I would appreciate it if anyone can explain how this might make sense...but please only try if you really believe it is a defensible behavior for the language. Thanks, Tim