# ListRemoveDuplicates

De-duplicates a delimited list - either case-sensitively or case-insenstively

## Method Signature

```
ListRemoveDuplicates(list=[string], delimiter=[string], ignoreCase=[boolean], includeEmptyFields=[boolean], multiCharacterDelimiter=[boolean])
```

### Arguments

| Argument                  | Type      | Required | Description                                                                    | Default |
| ------------------------- | --------- | -------- | ------------------------------------------------------------------------------ | ------- |
| `list`                    | `string`  | `true`   | The list to deduplicate                                                        |         |
| `delimiter`               | `string`  | `false`  | The delimiter of the list                                                      | `,`     |
| `ignoreCase`              | `boolean` | `false`  | Whether case should be ignored or not during deduplication - defaults to false | `false` |
| `includeEmptyFields`      | `boolean` | `false`  |                                                                                | `false` |
| `multiCharacterDelimiter` | `boolean` | `false`  |                                                                                | `false` |

## Examples

### Basic usage (case-sensitive)

Basic usage. Optional arguments left as defaults.

[Run Example](https://try.boxlang.io/?code=eJzLySwuCUrNzS9LdSktyMlMTixJLdZQUMrPS9UpKc%2FXKckoSk3VScsvLdJJyyxL1QGJgxlgCSUFTWsuAESpF6U%3D)

```java
listRemoveDuplicates( "one,two,three,four,five,one,five,three" );

```

Result: one,two,three,four,five

### Optional arguments usage (ignore case = true)

Optional arguments being set. Ignore case set to true

[Run Example](https://try.boxlang.io/?code=eJzLySwuCUrNzS9LdSktyMlMTixJLdZQUMrPS9UpKc%2FXKckoSk3VScsvLdJJyyxL1fH3c9UJCffXCfEIcnVV0lFQ0gESJUWlqQqa1lwAH%2BQYvQ%3D%3D)

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

```

Result: one,two,three,four,five

### Additional Examples

[Run Example](https://try.boxlang.io/?code=eJxtjjEKwzAMRfecQnhqwJADJO3UsVNvUGIRG5TI2HJ9%2FSgmdAjdpPefPqIscAczf8SuXDJax4s9tpmrXViH7BFjQxqZsaspCHKRWOQGpOf9hZnJp4c58DDAhhUoqFWDeHAlUtAqzJBw5S%2B6jtoDL1XejTx%2Fyv%2F2k%2B3vsj9X)

```java
lst = "cat,mouse,dog,cat,cow,goat,sheep,cat,dog";
writeoutput( lst );
writeoutput( "<hr>" );
// new list with duplicates removed
lst = ListRemoveDuplicates( lst );
writeoutput( lst );

```

## Related

* [GetToken](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/gettoken)
* [ListAppend](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listappend)
* [ListAvg](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listavg)
* [ListChangeDelims](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listchangedelims)
* [ListCompact](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listcompact)
* [ListContains](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listcontains)
* [ListContainsNoCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listcontainsnocase)
* [ListDeleteAt](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listdeleteat)
* [ListEach](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listeach)
* [ListEvery](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listevery)
* [ListFilter](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listfilter)
* [ListFind](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listfind)
* [ListFindNoCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listfindnocase)
* [ListFirst](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listfirst)
* [ListGetAt](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listgetat)
* [ListGetEndings](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listgetendings)
* [ListIndexExists](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listindexexists)
* [ListInsertAt](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listinsertat)
* [ListItemTrim](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listitemtrim)
* [ListLast](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listlast)
* [ListLen](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listlen)
* [ListMap](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listmap)
* [ListNone](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listnone)
* [ListPrepend](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listprepend)
* [ListQualify](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listqualify)
* [ListReduceRight](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listreduceright)
* [ListRest](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listrest)
* [ListSetAt](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listsetat)
* [ListSome](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listsome)
* [ListSort](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listsort)
* [ListToArray](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listtoarray)
* [ListTrim](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listtrim)
* [ListValueCount](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listvaluecount)
* [ListValueCountNoCase](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listvaluecountnocase)
