Home
Ruby
ActiveRecord
Array
CGI
Class
Collections
Database
Date
Design Patterns
Development
File Directory
GUI
Hash
Language Basics
Method
Network
Number
Rails
Range
Reflection
Statement
String
Threads
Time
Tk
Unit Test
Windows Platform
XML
set multiple elements at the same time : Range Index « Array « Ruby
Ruby
Array
Range Index
set multiple elements at the same time
a[1..3] = [
"a"
,
"b"
,
"c"
] puts a.inspect
Related examples in the same category
1.
use ranges as array indices to select multiple elements at the same time: