Coldfusion Array: Just need some help with an array.

brihol44
brihol44 used Ask the Experts™
on
Example Data of FORM.pickShipPref is a list: Example data "1, 2, 3"

<cfset pickedShipPreferences = ListToArray(FORM.pickShipPref)>

How can I capture the 1st segment or list item and set it to a variable?

Thank you,

Brian
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2015
Commented:
Use listFirst
<cfset myVariable = listFirst(FORM.pickShipPref)>  

or you could also use listGetAt(list, position, delim)

<cfset myVariable = listGetAt(FORM.pickShipPref, 1)>



Author

Commented:
Awesome! Thx!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial