P
Peter Szinek
Hello,
Sorry for the lame question again, but even after a lot of googling I
still couldn't find the $subj., ie. something like:
(= every second letter, beginning from the 2nd index in the string)
(= 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
Sorry for the lame question again, but even after a lot of googling I
still couldn't find the $subj., ie. something like:
'dgj'"asdfghj"[2::2]
(= every second letter, beginning from the 2nd index in the string)
'jhgfdsa'"asdfghj"[::-1]
(= 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