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

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