Created
November 19, 2015 02:45
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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