# collection.retain_all · Rell standard library · Chromia Docs (concept)

> function retain_ all(values: collection <-T>): boolean Retain in this collection only those elements found in the given collection. In other words, remove


Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/collection/retain_all/

FUNCTION

# collection.retain\_all

```signature
function retain_all(values: collection<-T>): boolean
```

Retain in this collection only those elements found in the given collection. In other words, remove
from this collection all elements that are not found in the given collection.

**Parameters**

* **values** — the collection of elements to retain

**Returns**

`true` if any elements were removed from this collection, `false` if it was not modified

Since 0.14.16

[View this page on docs.chromia.com](https://docs.chromia.com/pages/rell-stdlib/-rell%20-system%20-library/%5Broot%5D/collection/retain_all.html)Generated API reference, mirrored from the live docs
