From: Hugh Sasse Staff Elec Eng nil,
if the nth element is not exist in the array.
self[start..end]
+
+See also
+self[nth] = val.
+
self[start..end]
Returns an array containing the objects from start to
-end, including both ends. if end is larger than
-the length of the array, it will be rounded to the length. If
-start is out of an array range , returns nil.
-And if start is larger than end with in array
-range, returns empty array ([]).
+end, including both ends. If ... is used (instead
+of ..), then end is not included. if end
+is larger than the length of the array, it will be rounded to the
+length. If start is out of an array range , returns
+nil. And if start is larger than end
+with in array range, returns empty array ([]).
self[start, length]
+
+See also
+self[start..end] = val.
+
self[start, length]
Returns an array containing length items from
start. Returns nil if
length is negative.
self[start, length] = val.
++
self[nth] = val
nil.
-self[start..end] = val
+
+See also
+self[nth].
+
self[start..end] = val
Replace the items from start to end with
-val. If val is not an array, the type of
-val will be converted into the Array using
+val. If ... is used (instead of ..)
+then end is not included. If val is not an array,
+the type of val will be converted into the Array using
to_a method.
self[start, length] = val
+
+See also
+self[start..end].
+
self[start, length] = val
Replace the length items from start with
val. If val is not an array, the type of
val will be converted into the Array using
to_a.
+
+See also
+self[start, length].
Example: