How to read a string with spaces in Java
<p>I am trying to read a user input string which must contain spaces.  Right now I'm using:</p>

<pre><code>check = in.nextLine();

position = name.names.indexOf(check);
if (position != -1) {
  name.names.get(position);
} else {
  System.out.println("Name does not exist");
}
</code></pre>

<p>this just returns various errors.</p>
