Skip to content

Instantly share code, notes, and snippets.

@steinbring
Created November 19, 2015 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steinbring/4edb7c784dd4d672056e to your computer and use it in GitHub Desktop.
Save steinbring/4edb7c784dd4d672056e to your computer and use it in GitHub Desktop.
I stumbled across this the other day. Want to remove null items from a list? Convert it to an array and back again.
<cfscript>
//A list that includes null items
list = 'Joe,Lisa,,,Beth,John,,,Tom,Liz,Tina,,,,,,,,Omar';
writedump(list);
//Clear out the null items
list = ArrayToList(ListToArray(list));
writedump(list);
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment