---
schema_version: "1"
id: 8582c104f1384c1f8e29d72456c764222fc045ff0f2162be39a1edcb73ef7b92
title: words
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/latest/dw-strings-functions-words.md
canonical_url: https://docs.mulesoft.com/dataweave/latest/dw-strings-functions-words
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 0a06f8692f89ff65ef2859c01e899978cccac079025f0f422ea1a595760db0aa
description: MuleSoft Documentation Site
release: "2.13"
latest: true
---
---
product: DataWeave
version: 2.13
is-latest-version: true
---

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