static int smartLastIndexOf(S s, char c) {
if (s == null) ret 0;
int i = s.lastIndexOf(c);
ret i >= 0 ? i : l(s);
}
static int smartLastIndexOf(L l, A sub) {
ret smartLastIndexOf(l, sub, 0);
}
static int smartLastIndexOf(L l, int start, A sub) {
ret smartLastIndexOf(l, sub, start);
}
static int smartLastIndexOf(L l, A sub, int start) {
int i = lastIndexOf(l, start, sub);
ret i < 0 ? l(l) : i;
}