Java ArrayList: cut off ending on each element
<p>Method returns ArrayList in this form:</p>

<pre><code>[Josh 218.4328329 424324324, Daniel 645.6456456 939438292, James 932.3012930 328492343]
</code></pre>

<p>But I only need the names, so I want the following:</p>

<pre><code>[Josh, Daniel, James]
</code></pre>

<p>How do I cut off everything after the name (including the space after the name) in each item in this ArrayList? Possible solution to specify that I want to start removing everything on first space in the item?</p>

<p>Thank you</p>