---
schema_version: "1"
id: 69591cb7f11586e8ab0743eab9a1d6de8a426083a4b25b66e6c23994ceee5eaf
title: remove
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.11/dw-strings-functions-remove.md
canonical_url: https://docs.mulesoft.com/dataweave/2.11/dw-strings-functions-remove
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 543a5ef400b23850a907bec271543f5d82c02ba6c0aeafb885898a4664a78350
description: MuleSoft Documentation Site
release: "2.11"
latest: false
---
---
product: DataWeave
version: 2.11
---

# remove

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## remove(text: String, toRemove: String): String

Removes all occurrences of a specified pattern from a string.

_Introduced in DataWeave version 2.4.0._

### Parameters

<table><colgroup><col> <col></colgroup><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><p><code>text</code></p></td><td><p>The text to remove from.</p></td></tr><tr><td><p><code>toRemove</code></p></td><td><p>The pattern to remove.</p></td></tr></tbody></table>

### Example

This example shows how the `remove` can be used to remove some unwanted properties.

#### Source

```DataWeave
%dw 2.0
import remove from dw::core::Strings
output application/json
---
"lazyness purity state higher-order stateful" remove "state"
```

#### Output

```Json
"lazyness purity  higher-order ful"
```

## remove(text: Null, toRemove: Any): Null

Helper function that enables `remove` to work with a `null` value.

_Introduced in DataWeave version 2.4.0._
