From: first name Date: 2012-04-06T09:05:16+09:00 Subject: unexpected behavior of indexing / .length first I have: signature = Base64.encode64(@stored_priv_key.dsa_sign_asn1(message)) puts "first signature length is #{signature.length}" => first signature length is 78 then later in a different method I have signature = decrypted[0,77] puts "second signature length is #{signature.length}" => signature length is 77 Now I can get this to work by making the range [0,78] (which returns a 78 character string) but it seems like it is not starting from 0 which is not the expected behavior. Even though it works when I make the range 0,78 it is not how it is supposed to be as far as I can tell, because it should be starting at 0 which counts for length 1 and then going up to position 77 which counts for 77 other additions to length in addition to the first 0. I don't have ALL of my code here and maybe you need to see it all, but what could ever cause the behavior or an indexed range creating a length that is as large as the largest number in the range (instead of +1, taking the 0 position into account) -- Posted via http://www.ruby-forum.com/.