The lastindexof() Function

This function has two signatures:

lastindexof('abcdbc', 'bc') returns 4.

lastindexof('abcdbccdbc', 'bc', 2) returns 1.