static A[] dropLast(A[] a, int n default 1) {
if (a == null) null;
n = Math.min(n, a.length);
A[] b = arrayOfSameType(a, a.length-n);
System.arraycopy(a, 0, b, 0, b.length);
ret b;
}
static L dropLast(L l) {
ret subList(l, 0, l(l)-1);
}
static L dropLast(int n, L l) {
ret subList(l, 0, l(l)-n);
}
static L dropLast(Iterable l) {
ret dropLast(asList(l));
}
static S dropLast(S s) {
ret substring(s, 0, l(s)-1);
}
static S dropLast(S s, int n) {
ret substring(s, 0, l(s)-n);
}
static S dropLast(int n, S s) {
ret dropLast(s, n);
}