static private final int collapseStart(String s) {
    for (int i = 0, len = s.length(); i < len; i++) {
      switch (s.charAt(i)) {
      case ' ':
        if (i == 0 || s.charAt(i - 1) == ' ' || i == len - 1)
          return i;
        break;
      case '\r':
      case '\n':
      case '\t':
        return i;
      }
    }
    return -1;
  }