⚝
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 :
each_index-i.ri
U:RDoc::AnyMethod[iI"each_index:ETI"Array#each_index;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"!Iterates over array indexes.;To:RDoc::Markup::BlankLine o; ; [I"JWhen a block given, passes each successive array index to the block; ;TI"returns +self+:;To:RDoc::Markup::Verbatim; [I"a = [:foo, 'bar', 2] ;TI":a.each_index {|index| puts "#{index} #{a[index]}" } ;T:@format0o; ; [I"Output:;To;; [I"0 foo ;TI"1 bar ;TI" 2 2 ;T; 0o; ; [I"6Allows the array to be modified during iteration:;To;; [I"a = [:foo, 'bar', 2] ;TI">a.each_index {|index| puts index; a.clear if index > 0 } ;T; 0o; ; [I"Output:;To;; [I"0 ;TI"1 ;T; 0o; ; [I"4When no block given, returns a new \Enumerator:;To;; [ I"a = [:foo, 'bar', 2] ;TI"e = a.each_index ;TI"7e # => #
;TI"8a1 = e.each {|index| puts "#{index} #{a[index]}"} ;T; 0o; ; [I"Output:;To;; [I"0 foo ;TI"1 bar ;TI" 2 2 ;T; 0o; ; [I"#Related: #each, #reverse_each.;T: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I"Larray.each_index {|index| ... } -> self array.each_index -> Enumerator ;T0[ I"();T@AFI" Array;TcRDoc::NormalClass00