⚝
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 :
find_index-i.ri
U:RDoc::AnyMethod[iI"find_index:ETI"Array#find_index;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I".Returns the index of a specified element.;To:RDoc::Markup::BlankLine o; ; [I"3When argument +object+ is given but no block, ;TI"6returns the index of the first element +element+ ;TI"*for which
object == element
:;To:RDoc::Markup::Verbatim; [I"!a = [:foo, 'bar', 2, 'bar'] ;TI"a.index('bar') # => 1 ;T:@format0o; ; [I",Returns +nil+ if no such element found.;T@o; ; [I"8When both argument +object+ and a block are given, ;TI"3calls the block with each successive element; ;TI"Wreturns the index of the first element for which the block returns a truthy value:;To;; [I"!a = [:foo, 'bar', 2, 'bar'] ;TI"2a.index {|element| element == 'bar' } # => 1 ;T; 0o; ; [I"=Returns +nil+ if the block never returns a truthy value.;T@o; ; [I"MWhen neither an argument nor a block is given, returns a new Enumerator:;To;; [ I"a = [:foo, 'bar', 2] ;TI"e = a.index ;TI"2e # => #
;TI"1e.each {|element| element == 'bar' } # => 1 ;T; 0o; ; [I"2Array#find_index is an alias for Array#index.;T@o; ; [I"Related: #rindex.;T: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I"xarray.index(object) -> integer or nil array.index {|element| ... } -> integer or nil array.index -> new_enumerator ;T0[[I" index;T@ I"(*args);T@6FI" Array;TcRDoc::NormalClass00