static int trimIndexRight(S s, int i) { while (i < l(s) && s.charAt(i) == ' ') ++i; ret i; }