1

Closed

"".rindex("somestring") raises RangeError

description

IronRuby version - IronRuby 0.9.4.0 (1.0 RC2)
Platform - Ubuntu 9.10, Mono 2.4.2.3
 
Issue description:
 
The code below:
 
"".rindex("aaa")
 
In IronRuby it raises
 
mscorlib:0:in `LastIndexOfOrdinal': Argument is out of range.\nParameter name: startIndex (RangeError)
from mscorlib:0:in `LastIndexOf'
from :0:in `rindex'
from (ir):1
 
But in MRI it returns nil
 
Also in IronRuby
 
"".index("aaa") returns nil
"".rindex("aaa", -1) returns nil
Closed Jul 28, 2011 at 3:04 PM by jimmysch
Works on the latest version of IronRuby and Mono 2.6.7

comments

TomasMatousek wrote Feb 23, 2010 at 3:56 AM

It works on .NET. Looks like a bug in Mono.