public static int LastIndexOf(this Rope<char> rope, string searchText, int startIndex, int length,
StringComparison comparisonType)
{
if (rope == null)
throw new ArgumentNullException("rope");
if (searchText == null)
throw new ArgumentNullException("searchText");
rope.VerifyRange(startIndex, length);
var pos = rope.ToString(startIndex, length).LastIndexOf(searchText, comparisonType);
if (pos < 0)
return -1;
return pos + startIndex;
}
}