code: private static final int previousSpaceIndex(StringBuffer sb, int seek) {
      seek--;
      while (seek > 0) {
        if (sb.charAt(seek) == ' ') {
          while (seek > 0 && sb.charAt(seek - 1) == ' ')
            seek--;
          return seek;
        }
        seek--;
      }
      return 0;
    }
docs: Finds the index of the nearest space before a specified index.
  
  @param sb   The string buffer which contains the text being examined.
  @param seek The index to begin searching from.
  @return The index which contains the nearest space.