title: How to count letter of each word
body: <p>I was wondering how I would write a method to count the number of words and  number of each word letters
  for example  if input is  "The Blue Sky" in return i take something that show me there was 3 words 3 letter 4 letter 3 letter</p>
  
  <p>i'v found this code already </p>
  
  <pre><code>public static int countWords(String s){
  
      int wordCount = 0;
  
      boolean word = false;
      int endOfLine = s.length() - 1;
  
      for (int i = 0; i &lt; s.length(); i++) {
          // if the char is a letter, word = true.
          if (Character.isLetter(s.charAt(i)) &amp;&amp; i != endOfLine) {
              word = true;
              // if char isn't a letter and there have been letters before,
              // counter goes up.
          } else if (!Character.isLetter(s.charAt(i)) &amp;&amp; word) {
              wordCount++;
              word = false;
              // last word of String; if it doesn't end with a non letter, it
              // wouldn't count without this.
          } else if (Character.isLetter(s.charAt(i)) &amp;&amp; i == endOfLine) {
              wordCount++;
          }
      }
      return wordCount;
  }
  </code></pre>
  
  <p>I really appreciate any help I can get! Thanks!</p>