⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
share
/
ri
/
3.0.0
/
system
/
Array
/
View File Name :
slice%21-i.ri
U:RDoc::AnyMethod[iI"slice!:ETI"Array#slice!;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I".Removes and returns elements from +self+.;To:RDoc::Markup::BlankLine o; ; [I"0When the only argument is an \Integer +n+, ;TI"5removes and returns the _nth_ element in +self+:;To:RDoc::Markup::Verbatim; [I"a = [:foo, 'bar', 2] ;TI"a.slice!(1) # => "bar" ;TI"a # => [:foo, 2] ;T:@format0o; ; [I"AIf +n+ is negative, counts backwards from the end of +self+:;To;; [I"a = [:foo, 'bar', 2] ;TI"a.slice!(-1) # => 2 ;TI"a # => [:foo, "bar"] ;T; 0o; ; [I"+If +n+ is out of range, returns +nil+.;T@o; ; [I"@When the only arguments are Integers +start+ and +length+, ;TI"Iremoves +length+ elements from +self+ beginning at offset +start+; ;TI"0returns the deleted objects in a new Array:;To;; [I"a = [:foo, 'bar', 2] ;TI"'a.slice!(0, 2) # => [:foo, "bar"] ;TI"a # => [2] ;T; 0o; ; [I"8If
start + length
exceeds the array size, ;TI"Eremoves and returns all elements from offset +start+ to the end:;To;; [I"a = [:foo, 'bar', 2] ;TI"%a.slice!(1, 50) # => ["bar", 2] ;TI"a # => [:foo] ;T; 0o; ; [I"?If
start == a.size
and +length+ is non-negative, ;TI" returns a new empty \Array.;T@o; ; [I",If +length+ is negative, returns +nil+.;T@o; ; [I"8When the only argument is a \Range object +range+, ;TI"Ztreats
range.min
as +start+ above and
range.size
as +length+ above:;To;; [I"a = [:foo, 'bar', 2] ;TI"% a.slice!(1..2) # => ["bar", 2] ;TI"a # => [:foo] ;T; 0o; ; [I"CIf
range.start == a.size
, returns a new empty \Array.;T@o; ; [I"JIf
range.start
is larger than the array size, returns +nil+.;T@o; ; [I"SIf
range.end
is negative, counts backwards from the end of the array:;To;; [I"a = [:foo, 'bar', 2] ;TI"(a.slice!(0..-2) # => [:foo, "bar"] ;TI"a # => [2] ;T; 0o; ; [I"*If
range.start
is negative, ;TI"Dcalculates the start index backwards from the end of the array:;To;; [I"a = [:foo, 'bar', 2] ;TI"%a.slice!(-2..2) # => ["bar", 2] ;TI"a # => [:foo];T; 0: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I"~array.slice!(n) -> object or nil array.slice!(start, length) -> new_array or nil array.slice!(range) -> new_array or nil ;T0[ I"(*args);T@]FI" Array;TcRDoc::NormalClass00