π File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: Apache
2026-06-22 05:48:03
π
/ (Root)
/
opt
/
alt
/
ruby27
/
share
/
ri
/
system
/
Array
π /opt/alt/ruby27/share/ri/system/Array
π Refresh
βοΈ
Editing: slice-i.ri
Read Only
U:RDoc::AnyMethod[iI" slice:ETI"Array#slice;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"HElement Reference --- Returns the element at +index+, or returns a ;TI"Hsubarray starting at the +start+ index and continuing for +length+ ;TI"Eelements, or returns a subarray specified by +range+ of indices.;To:RDoc::Markup::BlankLine o; ; [ I"ONegative indices count backward from the end of the array (-1 is the last ;TI"Pelement). For +start+ and +range+ cases the starting index is just before ;TI"Man element. Additionally, an empty array is returned when the starting ;TI";index for an element range is at the end of the array.;T@o; ; [I"EReturns +nil+ if the index (or starting index) are out of range.;T@o:RDoc::Markup::Verbatim; [I"%a = [ "a", "b", "c", "d", "e" ] ;TI"&a[2] + a[0] + a[1] #=> "cab" ;TI"$a[6] #=> nil ;TI"-a[1, 2] #=> [ "b", "c" ] ;TI"2a[1..3] #=> [ "b", "c", "d" ] ;TI"(a[4..7] #=> [ "e" ] ;TI"$a[6..10] #=> nil ;TI"2a[-3, 3] #=> [ "c", "d", "e" ] ;TI"# special cases ;TI"$a[5] #=> nil ;TI"$a[6, 1] #=> nil ;TI"#a[5, 1] #=> [] ;TI""a[5..10] #=> [];T:@format0: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I"οΏ½ary.slice(index) -> obj or nil ary.slice(start, length) -> new_ary or nil ary.slice(range) -> new_ary or nil;T0[ I"(*args);T@)FI" Array;TcRDoc::NormalClass00
πΎ Save Changes
β Cancel