Ruby/Array/Range Index
Материал из Wiki.crossplatform.ru
Версия от 17:10, 26 мая 2010; (Обсуждение)
set multiple elements at the same time
a[1..3] = ["a", "b", "c"] puts a.inspect
use ranges as array indices to select multiple elements at the same time:
a = [2, 4, 6, 8, 10, 12] puts a[1..3].inspect