Hi, 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.
list = []
list.add(params["firstNames"].split())
is returning a list with size 1, with the list element being a string containing all the names.
also, if I do list = params["firstNames"].split())
, 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.
what is it that I'm doing wrong?
thanks for the help.