Removing duplicates from lists
<!--- The list with want to clean up ---> <cfset lst = "a,list,with,a,few,duplicates"> <!--- Use a struct to build a set of the list elements ---> <cfset set = StructNew()> <cfloop index="elem" list="#lst#"> <cfset set[elem] = ""> </cfloop> <!--- Convert the set back to a list ---> <cfset lst = StructKeyList(set)>
This sort of this should be familiar to all you perlmongers out there.