static int countLeadingSpaces(String s) { int i = 0; while (i < s.length() && (s.charAt(i) == ' ' || s.charAt(i) == '\t')) ++i; ret i; }