Cannot get the number of words in a variable
<p>I can successfully count the number of words in a phrase like:</p>

<pre><code>int numWords = "I am testing".split(" ").length;
</code></pre>

<p>(It returns 3.)</p>

<p>However, I am getting a user input and storing it in a string, then trying to count the number of words in it but it ALWAYS returns 1, no matter what.</p>

<p>I'm getting user input with a <code>stringVariable = scanner.next();</code> and using</p>

<pre><code>int numWords = stringVariable.split(" ").length;
</code></pre>

<p>to get the number of words. Let's say I type "I am testing". It will return 1. Why is this?</p>
