- May 30, 2019
- Posted by: iSummation Team
- Category: ColdFusion
No Comments

Hi All,
List’s function is very useful in ColdFusion technology. We often use lists in our code but sometime we find duplicate elements in the list and we need to remove it. Here is the simple function to remove duplicate elements from list. Have a look at below code I hope it will helpful for you.
1 2 3 4 5 6 7 8 9 10 11 12 |
<cfscript> function removeDuplicateFromList(lst,delim){ var Lst2 = ''; for(i=1;i<=ListLen(lst);i++){ value = ListGetAt(lst,i); if(not ListFindNoCase(Lst2,value)){ Lst2 = ListAppend(Lst2,value,delim); } } return Lst2; } </cfscript> |