code: public String capWords(String value) {
          StringTokenizer st = new StringTokenizer(value);
          StringBuilder buffer = new StringBuilder();
          int count = st.countTokens();
          for (int i = 0; i < count; i++) {
              StringBuffer tempBuffer = new StringBuffer();
              String word = st.nextElement().toString();
              // first letter
              tempBuffer.append(word.substring(0, 1).toUpperCase());
              // rest of sentence
              tempBuffer.append( word.substring(1, word.length()).toLowerCase());
              buffer.append(tempBuffer.append(" "));
          }
          return buffer.toString().trim();
      }
docs: Capitalize each word within the given value. This assumes the words are
  separated by whitespace (<code>\n\r\t</code> and spaces).
  
  @param value The value to capitalize from
  
  @return The new string with capitalized words