listRemoveDuplicates

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

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

Argument Reference

list string
Required

Required. List of objects.

delimiter string
Default: ,

Optional. Character(s) that separate list elements. The default value is comma.

ignoreCase boolean
Default: false

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. Optional arguments left as defaults.

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

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

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

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub