---
schema_version: "1"
id: 516f5d6f8c2166dc6869a8f1110f73970808eabd8bb782438fef0950c5f1f44c
title: unwrap
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.3/dw-strings-functions-unwrap.md
canonical_url: https://docs.mulesoft.com/dataweave/2.3/dw-strings-functions-unwrap
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 4feab22dbb09d8ffb8392d6f47f7d5ee8d6e35d59187cf28a6a4e57447a3ab3f
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
---
product: DataWeave
version: 2.3
---

# unwrap

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

## unwrap(String, String): String

Unwraps a given `text` from a `wrapper` text.

_Introduced in DataWeave 2.2.0. Supported by Mule 4.2 and later._

### 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 input string.</p></td></tr><tr><td><p><code>wrapper</code></p></td><td><p>The text used to unwrap.</p></td></tr></tbody></table>

### Example

This example shows how `unwrap` behaves with different inputs and sizes.

#### Source

```DataWeave
%dw 2.0
import unwrap from dw::core::Strings
output application/json
---
{
  "a": unwrap(null, ""),
  "b": unwrap(null, '\0'),
  "c": unwrap("'abc'", "'"),
  "d": unwrap("AABabcBAA", 'A'),
  "e": unwrap("A", '#'),
  "f": unwrap("#A", '#'),
  "g": unwrap("A#", '#')
}
```

#### Output

```JSON
{
  "a": null,
  "b": null,
  "c": "abc",
  "d": "ABabcBA",
  "e": "A",
  "f": "A#",
  "g": "#A"
}
```

## unwrap(Null, String): Null

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