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

# 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._
