Mega Code Archive
Categories
/
Ruby
/
Array
Loop through each_index
a = ['a','b','c'] a.each_index {|i| print i} # Array-specific: prints "012"