title: How to take a delimited list, parse it, and add it to list
body: <p>I'm using Groovy and Grails and am trying to take a parameter passed to a controller, parse it, and add each individual element into a list. I thought this would work, but it is adding the whole string into the list, leaving me with only one element. </p>
  
  <pre><code>list = []
  
  list.add(params["firstNames"].split())
  </code></pre>
  
  <p>is returning a list with size 1, with the list element being a string containing all the names. </p>
  
  <p>also, if I do <code>list = params["firstNames"].split())</code> , it is showing a size of 2 (i have two elements) but it is still treating it as a String and I cannot perform any other list operations on it. </p>
  
  <p>what is it that I'm doing wrong?</p>
  
  <p>thanks for the help.</p>