assert("_abc_abc_".lastIndexOf("abc") == 5); assert("__abc_".lastIndexOf("abc") == 2); assert("a".lastIndexOf("a") == 0); assert("aa".lastIndexOf("a") == 1); assert("abc".lastIndexOf("abc") == 0); assert("_".lastIndexOf("a") == -1); assert("_".lastIndexOf("__") == -1); assert("__".lastIndexOf("a") == -1);
assert("_".lastIndexOf('a') == -1); assert("a".lastIndexOf('a') == 0); assert("_a".lastIndexOf('a') == 1); assert("__a".lastIndexOf('a') == 2); assert("a__a".lastIndexOf('a') == 3);
Array-specialization of lastIndexOf with default predicate.