File: //usr/share/ri/3.0.0/system/Array/shift-i.ri
U:RDoc::AnyMethod[iI"
shift:ETI"Array#shift;TF:publico: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