str.rindex(substring [, fixnum]) â fixnum or nilstr.rindex(regexp [, fixnum]) â fixnum or nil
Instance Public methods
Returns the index of the last occurrence of the given substring or
pattern (regexp) in str. Returns nil if not
found. If the second parameter is present, it specifies the position in the
string to end the searchâcharacters beyond this point will not be
considered.
"hello".rindex('e') #=> 1
"hello".rindex('l') #=> 3
"hello".rindex('