Truncate sentence to a certain number of words
<p>How can a sentence be truncated to a certain number of words (NB. not letters)?</p>

<p>I thought to use <code>split(" ")</code>, but then how do I count out words?</p>

<p>For example:</p>

<ul>
<li><code>Javascript word count cut off</code> => <code>Javascript word count</code> </li>
<li><code>Want better search results? See our search tips!</code> => <code>Want better search</code></li>
</ul>
