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

# words

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

## words(text: String): Array<String>

Returns an array of words from a string.

Separators between words include blank spaces, new lines, and tabs.

_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 string to split into words.</p></td></tr></tbody></table>

### Example

This example divides a string by the `words` it contains. An `\n` represents a line break, and `\t`
represents a tab.

#### Source

```DataWeave
%dw 2.0
import words from dw::core::Strings
output application/json
---
words("hello world\nhere\t\t\tdata-weave")
```

#### Output

```Json
["hello", "world", "here", "data-weave"]
```

## words(text: Null): Null

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

_Introduced in DataWeave version 2.4.0._
