Flowdock
rindex(p1) public

Returns the index of the last object in array == to obj. Returns nil if no match is found.

   a = [ "a", "b", "b", "b", "c" ]
   a.rindex("b")   #=> 3
   a.rindex("z")   #=> nil
Show source
Register or log in to add new notes.
May 26, 2012 - (v1_9_3_125)
0 thanks

rindex with identically array elements

Code Example

a = [1,1,1]
a.rindex( a.min ) #=> 2