title: Javascript substr(); limit by word not char
body: <p>I would like to limit the substr by words and not chars.  I am thinking regular expression and spaces but don't know how to pull it off.</p>
  
  <p>Scenario: Limit a paragraph of words to 200 words using javascript/jQuery.</p>
  
  <pre><code>var $postBody = $postBody.substr(' ',200); 
  </code></pre>
  
  <p>This is great but splits words in half :)  Thanks ahead of time!</p>