Logo

Programming-Idioms

History of Idiom 44 > diff from v15 to v16

Edit summary for version 16 by :

Version 15

2015-08-22, 21:06:01

Version 16

2015-09-03, 16:28:31

Idiom #44 Insert element in list

Insert element x at position i in list s. Further elements must be shifted to the right.

Idiom #44 Insert element in list

Insert element x at position i in list s. Further elements must be shifted to the right.

Code
s.insert(i, x)
Doc URL
http://ruby-doc.org/core-2.2.3/Array.html#method-i-insert