code: public static String findFirstWord(String buffer) {
          if (buffer.indexOf(SPACE_CHAR) < 0)
              return buffer;
          else {
              buffer = Parser.trim(buffer);
              int index = buffer.indexOf(SPACE_CHAR);
              if (index > 0)
                  return buffer.substring(0, index);
              else
                  return buffer;
          }
      }
docs: If string contain space, return the text before the first space. Spaces in the beginning and end is removed with
  Parser.trim(..)
  
  @param buffer input
  @return first word