From: Peter Szinek Date: 2006-10-04T22:19:21+09:00 Subject: Equvialent of Python slices? Hello, Sorry for the lame question again, but even after a lot of googling I still couldn't find the $subj., ie. something like: >>> "asdfghj"[2::2] 'dgj' (= every second letter, beginning from the 2nd index in the string) >>> "asdfghj"[::-1] 'jhgfdsa' (= the whole word, 1 steps backwards - i.e. the reverse of the string) ranges in Ruby are similar, without the 3rd 'step' param, which I am missing frequently... Also, with slices, you can omit one or both delimiters (i.e. if you omit the first (last) one, it defaults to the 0th (last) index of the list - is there some simiar possibility in Ruby, too? Thx Peter http://www.rubyrailways.com