Description:-

If a list object contains many duplicate values, you can sort this list object & get unique/distinct values in ColdFusion by using this function.

listRemoveDuplicates( list, delimiter, ignoreCase );

Function Arguments Use:-

  • list -> list of objects/list contains duplicate values (this a required argument).
  • delimiter -> character that separates list elements (default value is , for this argument).
  • ignoreCase -> If true, ignores the case of strings in the list (default value is false for this argument).

Example:-

listRemoveDuplicates( "arun,sujan,rohit,arun,sujan,rohit" );

Result:- arun,sujan,rohit

listRemoveDuplicates( "arun|sujan|rohit|arun|sujan|rohit", "|" );

Result:- arun|sujan|rohit

listRemoveDuplicates( "arun|sujan|rohit|Arun|Sujan|Rohit", "|", flase );

Result:- arun|sujan|rohit|Arun|Sujan|Rohit

listRemoveDuplicates( "arun|sujan|rohit|Arun|Sujan|Rohit", "|", true );

Result:- arun|sujan|rohit