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

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