static int indexOfNonDigit(S s) { for i over s: if (!isDigit(s.charAt(i))) ret i; ret -1; }