📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: Apache
2026-06-22 05:21:52
📂
/ (Root)
/
opt
/
alt
/
ruby31
/
share
/
ri
/
system
/
Array
📍 /opt/alt/ruby31/share/ri/system/Array
🔄 Refresh
✏️
Editing: shift-i.ri
Read Only
U:RDoc::AnyMethod[iI" shift:ETI"Array#shift;TF:privateo:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"*Removes and returns leading elements.;To:RDoc::Markup::BlankLine o; ; [I"FWhen no argument is given, removes and returns the first element:;To:RDoc::Markup::Verbatim; [I"a = [:foo, 'bar', 2] ;TI"a.shift # => :foo ;TI"a # => ['bar', 2] ;T:@format0o; ; [I"&Returns +nil+ if +self+ is empty.;T@o; ; [I"SWhen positive \Integer argument +n+ is given, removes the first +n+ elements; ;TI",returns those elements in a new \Array:;To;; [I"a = [:foo, 'bar', 2] ;TI"#a.shift(2) # => [:foo, 'bar'] ;TI"a # => [2] ;T; 0o; ; [I"@If +n+ is as large as or larger than <tt>self.length</tt>, ;TI"Bremoves all elements; returns those elements in a new \Array:;To;; [I"a = [:foo, 'bar', 2] ;TI"&a.shift(3) # => [:foo, 'bar', 2] ;T; 0o; ; [I"FIf +n+ is zero, returns a new empty \Array; +self+ is unmodified.;T@o; ; [I"$Related: #push, #pop, #unshift.;T: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I">array.shift -> object or nil array.shift(n) -> new_array ;T0[ I"(*args);T@1FI" Array;TcRDoc::NormalClass00
💾 Save Changes
❌ Cancel