listRemoveDuplicates

Removes duplicate values (if they exist) in a list.

listRemoveDuplicates(list[, delimiter] [, ignoreCase]) → returns string

Argument Reference for the listRemoveDuplicates function

list

Required: Yes
Required. List of objects.

delimiter

Required: No
Default: ,
Optional. Character(s) that separate list elements. The default value is comma.

ignoreCase

Required: No
Default: NO
Optional. If true, ignores the case of strings in the list. By default the value is set to false.

Compatibility

ColdFusion:

Version 10+ ColdFusion 10: Added this function

Examples sample code invoking the listRemoveDuplicates function


Basic usage (case sensitive)

Basic usage. Optional arguments left as defaults.

listRemoveDuplicates("one,two,three,four,five,one,five,three")

Expected Result: one,two,three,four,five


Optional arguments usage (ignore case = true)

Optional arguments being set. Ignore case set to true

listRemoveDuplicates("one,two,three,four,five,ONE,TWO,THREE", ",", true)

Expected Result: one,two,three,four,five


Fork me on GitHub