> For the complete documentation index, see [llms.txt](https://boxlang.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listremoveduplicates.md).

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/list/listremoveduplicates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
