Hi,

in both 1.8.6 (2007-03-13) and 1.9.0 (2007-06-30):

obj = Object.new
def obj.to_str() "y" end
"ruby".index(obj) # => 3
"ruby".rindex(obj) # ~> in `rindex': type mismatch: Object given
(TypeError)

Kind regards,
Florian Gross